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

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

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts