I have a macro in 'ThisWorkbook' that will activate a MsgBox each time a worksheet is selected.
How can I have this MsgBox activate only once, not every time the sheet is selected?
Code Used:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'when a worksheet is opened
'shortcuts' worksheet in 'formulas' workbook
If Sh.Name = "Shortcuts" Then
MsgBox "My macro works when you open a worksheet not a workbook
"
Else
End If
End Sub
How can I have this MsgBox activate only once, not every time the sheet is selected?
Code Used:
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
'when a worksheet is opened
'shortcuts' worksheet in 'formulas' workbook
If Sh.Name = "Shortcuts" Then
MsgBox "My macro works when you open a worksheet not a workbook
Else
End If
End Sub