Create a message to 'pop open'

J

JoeP

I would like to know the code for use in a macro that will cause a Message to
'pop open' when I click on to another sheet, or close the file. The message
would read something like 'Before proceeding do you want to protect the
sheet?'

Thanks for any help.
 
M

Mike

Paste this into the Thisworkbook Module

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim strmsg As String

strmsg = ActiveSheet.Name & vbCrLf & "Would you like to Protect Sheet"
MsgBox strmsg
End Sub
 
M

Mike

Paste both oh these into thisworkbook module
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim strmsg As String

strmsg = "Before proceeding would you like to protect" _
& vbCrLf & ActiveSheet.Name
MsgBox strmsg
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim strmsg As String

strmsg = "Before proceeding would you like to protect" _
& vbCrLf & ActiveSheet.Name
MsgBox strmsg

End Sub
 
Top