Thursday, 23 April 2015

VBA Input Box and Message Box Response to Stop or Run a Macro

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

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


No comments:

Post a Comment

Hi User, Thank You for Visiting My Blog. Please Post Your Feedback/Comments/Query.

Subscribe to Blog Posts by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts