MsgBox Function and Arguments

  • Thread starter Thread starter Tinä
  • Start date Start date
T

Tinä

Hi,

Using the Buttons Arguments: I have a 2-Button OK and Cancel Messag
Box. At the moment, it makes know difference whether I click on OK o
Cancel, my copying process is still executed. How do I get the Cance
Button to terminate the copying action and, how are the Button Retur
Values used? Excel Help says that the Return Value Constants can b
used anywhere in your code but I don't understand how or when to us
them.

Thanks
Tin
 
Sub Tester1()
ans = MsgBox(Prompt:="Go or Cancel", Buttons:=vbOKCancel)
If ans = vbCancel Then
Exit Sub
End If

MsgBox "You said OK"
' current code

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top