Hi all,
I want to convert a sentence (stored as a string variable) from the present tense to the past tense but I'm having trouble locating the relevant string manipulation commands to accomplish the task.
Does anybody have any idea how I could do this within my current code (shown below)?
I want to convert a sentence (stored as a string variable) from the present tense to the past tense but I'm having trouble locating the relevant string manipulation commands to accomplish the task.
Does anybody have any idea how I could do this within my current code (shown below)?
Code:
Sub TestMacro()'
' TestMacro Macro
'
' Create string variable
Dim undoText As String
' Assign the text to string variable
undoText = Mid$(Application.CommandBars(1).Controls("Edit").Controls(1).Caption, 6)
' See if Excel has just been launched
If StrComp(" &Undo", undoText, False) = 0 Then
MsgBox ("Welcome.")
Else
' Change text to be in past tense
' PUT CODE HERE!
' Add the text to the string to be displayed in a message box
MsgBox ("You just" & undoText & ".")
End If
End Sub
' Repeatedly check for user interaction whenever a change is detected
Private Sub Worksheet_Change(ByVal Target As Range)
Call TestMacro
End Sub