How Run or Stop a Macro with VBA Input Box and Message Box Responses
Sub Run_Stop_Macro()
Alert = MsgBox("The Macro will Update the Report with Latest Data ", vbYesNo, "Do You Wants to Update the Data Now ?")
If Alert = vbNo Then Exit Sub
ReTry:
PW = InputBox("Enter the Password To Run a Macro", "Please Enter the Password", vbOKCancel)
If PW = vbNullString Then Exit Sub
If Application.Proper(PW) <> "Tamatam" Then
MsgBox "Please Enter the Correct Password", vbCritical, "Wrong Password! Try Again!"
GoTo ReTry:
End If
'Macro Code Stuff for Your Requirement here.....You Go......
End Sub
Thanks,
TAMATAM
Sub Run_Stop_Macro()
Alert = MsgBox("The Macro will Update the Report with Latest Data ", vbYesNo, "Do You Wants to Update the Data Now ?")
If Alert = vbNo Then Exit Sub
ReTry:
PW = InputBox("Enter the Password To Run a Macro", "Please Enter the Password", vbOKCancel)
If PW = vbNullString Then Exit Sub
If Application.Proper(PW) <> "Tamatam" Then
MsgBox "Please Enter the Correct Password", vbCritical, "Wrong Password! Try Again!"
GoTo ReTry:
End If
'Macro Code Stuff for Your Requirement here.....You Go......
End Sub
Thanks,
TAMATAM
No comments:
Post a Comment
Hi User, Thank You for visiting My Blog. Please post your genuine Feedback or comments only related to this Blog Posts. Please do not post any Spam comments or Advertising kind of comments which will be Ignored.