Protected Macro Activation

D

Db1712

Is there a way to setup a macro that will prior to activating request
valid password or a warning drop down box. A little more info...I se
up a button to activate a macro to clear out data within a wor
book..I just don't want any permature erasers. Thanks in advance fo
any assistance with this
 
D

Dave Peterson

Just a simple yes/no question ok?

Option Explicit
Sub testme01()

Dim resp As Long

resp = MsgBox(prompt:="Are you sure you want to do this?", _
Buttons:=vbYesNo)

If resp = vbNo Then
Exit Sub
End If

'your code here

End Sub
 
Top