Answer:
Step-by-step explanation:
Using an Excel VBA string function to write the sub
Initially:
To loop from the last character back unto the first, we have to Offset in order to increase the column with each iteration of the for loop, as well as Mid$ just to return the characters one at a time.
Public Sub Question() Dim Word As String Dim Cnt As Integer Word = InputBox("Please Enter a word") For Cnt = Len(Word) To 1 Step -1 Range("C2").Offset(, Len(Word) - Cnt).Value = Mid$(Word, Cnt, 1) Next End Sub
Similarly, suppose we want to use StrReverse: Then; we can write it as;
Public Sub Question2() Dim Word As String Dim Cnt As Integer Word = InputBox("Please Enter a word") Word = StrReverse(Word) For Cnt = 1 To Len(Word) Range("C2").Offset(, Cnt - 1).Value = Mid$(Word, Cnt, 1) Next End Sub