**The below screenshot has VBA codes in the editor windo 3 subs. The instructions on the expected codes ' logic is provided as a comment in the visual basic edito. there are syntax error, and logical errors. solve the errors and make sure that the 3 subs are working correctly. *** Option Explicit 'This code would highlight alternate rows in the selection from Range A1:A10 Sub HighlightAlternateRows() Dim Myrange As Range Dim Myrow As Integer Range("A1:A10").Select Set Myrange = Selection For Each Myrow In Myrange.Rows If Myrow.Row Mod 2 = 1 Myrow.Interior.Color = vbCyan End If Next Myrow End Sub 'This code will change the values from A1:A24 to Upper Case Sub ChangeCase() Dim Rng As Range Range("A1:A23").Select For Each Rng In Selection.Cells If Rng.HasFormula = False Then Rng.Value = UCase(Rng.Value) Next Rng End 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 as forward, '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 a palindrome or not") Palindromecheck = "Trues" 'initialize the boolean variable to true idx = 1 ldx = Length(getStr) ' measures the length of the entered string 'Strip only numbers (1-9) & albhabets (A-Z and a-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 a string iStr = iStr & UCase(Mid(getStr, idx, 1)) End If idx = idx + 1 Wend 'Check whether reverse of string is also same for Palindrome 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 display message Else MsgBox ('The word " & iStr & " is NOT a Palindrome") End If End Sub

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter15: Using Javafx And Scene Builder
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

**The below screenshot has VBA codes in the editor windo 3 subs. The instructions on the expected codes ' logic is provided as a comment in the visual basic edito. there are syntax error, and logical errors. solve the errors and make sure that the 3 subs are working correctly. ***

 

Option Explicit

'This code would highlight alternate rows in the selection from Range A1:A10
Sub HighlightAlternateRows()
Dim Myrange As Range
Dim Myrow As Integer
Range("A1:A10").Select
Set Myrange = Selection
For Each Myrow In Myrange.Rows
   If Myrow.Row Mod 2 = 1
      Myrow.Interior.Color = vbCyan
   End If
Next Myrow
End Sub

'This code will change the values from A1:A24 to Upper Case
Sub ChangeCase()
Dim Rng As Range
Range("A1:A23").Select

For Each Rng In Selection.Cells
If Rng.HasFormula = False Then
Rng.Value = UCase(Rng.Value)
Next Rng
End 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 as forward,
'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 a palindrome or not")
    Palindromecheck = "Trues" 'initialize the boolean variable to true
    idx = 1
    ldx = Length(getStr) ' measures the length of the entered string

    'Strip only numbers (1-9) & albhabets (A-Z and a-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 a string
            iStr = iStr & UCase(Mid(getStr, idx, 1))
        End If
        idx = idx + 1
    Wend
    
    'Check whether reverse of string is also same for Palindrome
    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 display message
    Else
        MsgBox ('The word " & iStr & " is NOT a Palindrome")
    End If
End 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
Transcribed Image Text: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
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Accessibility feature of Form
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage