The below screenshot has VBA codes in the editor window 3 subs. The instructions on the expected codes' logic is provide

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The below screenshot has VBA codes in the editor window 3 subs. The instructions on the expected codes' logic is provide

Post by answerhappygod »

The Below Screenshot Has Vba Codes In The Editor Window 3 Subs The Instructions On The Expected Codes Logic Is Provide 1
The Below Screenshot Has Vba Codes In The Editor Window 3 Subs The Instructions On The Expected Codes Logic Is Provide 1 (23.3 KiB) Viewed 15 times
Option Explicit
'This code will change the values from A1:A24 to UpperCaseSub ChangeCase()Dim Rng As RangeRange("A1:A23").Select
For Each Rng In Selection.CellsIf Rng.HasFormula = False ThenRng.Value = UCase(Rng.Value)Next RngEnd If
End Sub
Sub Palindrome()'Checks if the entered value is a Palindrome.'A palindrome is a word, number, phrase, or other'sequence of characters which reads the same backward asforward,'such as madam, racecar, detartrated, rotavator. Dim iStr As String Dim idx As Integer, ldx As Integer Dim getStr As String Dim Palindromecheck As Boolean getStr = InputBox("Enter a word to check if it is apalindrome or not") Palindromecheck = "Trues" 'initialize the booleanvariable to true idx = 1 ldx = Length(getStr) ' measures the length of theentered string
'Strip only numbers (1-9) & albhabets (A-Z anda-z) from input string While (idx <= ldx) If (Mid(getStr, idx, 1) Like"[1-9A-Za-z]") Then 'checks if each character is a number or astring iStr = iStr &UCase(Mid(getStr, idx, 1)) End If idx = idx + 1 Wend 'Check whether reverse of string is also same forPalindrome idx = 1 ldx = Len(iStr) While (idx < ldx) If (Mid(iStr, idx, 1) <>Mid(iStr, ldx, 1)) Then Palindromecheck ==False End If idx = idx + 1 ldx = ldx - 1 Wend If Palindromecheck == True Then MsgBox ("The word " iStr & "is a Palindrome") ' concatenate the strings to displaymessage Else MsgBox ('The word " & iStr & "is NOT a Palindrome") End IfEnd Sub
The below screenshot has VBA codes in the editor window 3 subs. The instructions on the expected codes' logic is provided as a comment in the visual basic editor. There are syntax error, and logical errors. Solve all the errors and make sure that the 3 subs are working correctly. A1 A 1 this 2 website 3 uses 4 cookies 5 to 6 improve 7 your 8 9 by 10 using 11 our 12 website, 13 you 14 hereby 15 consent 16 to 17 our 18 privacy 19 policy 20 and 21 agree 22 to 23 its 24 terms. 25 experience. ⠀ X B с fx this D E
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply