Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help With Message Box

Status
Not open for further replies.

BRANDON99

Technical User
Aug 29, 2003
52
FR
Hi all

I am using a meesage box that appears if an If statement is True, I want the user to be able to continue running the code when they click the OK button. Can someone please supply the code for this

Many Thanks

Brandon
 
Brandon,

What happens if the user selects cancel?
 
Brandon,

The code would be something like this.

Sub messagebox()
Dim response As Variant
If "Your test" Then
response = msgbox("Your message", vbOKCancel)
If response = vbCancel Then
Exit Sub 'this will exit the code
Else
'this will allow it to continue running
End If
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top