Worksheets are named like *1, *2, etc. I want to plug the current date in A1 of the active sheet if the sheet changes but only if its name is like *2.
My feeble attempt:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Application.EnableEvents = False
For ActiveSheet
If Sh.Name = Like "*2" Then
Sh.[A1] = Date
End If
Application.EnableEvents = True
End Sub
I know there's a problem with the "For..." line but I don't want to have to loop through every sheet. How can I have this work just on the active sheet?
My feeble attempt:
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Excel.Range)
Application.EnableEvents = False
For ActiveSheet
If Sh.Name = Like "*2" Then
Sh.[A1] = Date
End If
Application.EnableEvents = True
End Sub
I know there's a problem with the "For..." line but I don't want to have to loop through every sheet. How can I have this work just on the active sheet?