I would like to rename my worksheets depending on the presence of a word in a text-filled cell A1. Basically, my problem is that I do not know the syntax to find one element of many in one cell. Do I need to parse out X from the sentence contained in A1 first?
Sub RenameSheet()
Dim wkst as Worksheet
x = "Annual"
y = "1st Quarter"
For Each wkst in Worksheets
If Range("A1") contains X Then
'what is syntax for contains?
wkst.Name = X
Next wkst
End Sub
Sub RenameSheet()
Dim wkst as Worksheet
x = "Annual"
y = "1st Quarter"
For Each wkst in Worksheets
If Range("A1") contains X Then
'what is syntax for contains?
wkst.Name = X
Next wkst
End Sub