Declare variable as what?

  • Thread starter Thread starter N E Body
  • Start date Start date
N

N E Body

Hello

Could someone advise me as what the following should be declared as?

Ans = MsgBox("If boxes are empty you will wipe out the list - continue?",
vbYesNo, "Caution")
If Ans = vbNo Then Exit Sub

TIA

Kenny
 
Also you can do it like this, without declaring a variable:

If MsgBox("If boxes are empty you will wipe out the list - continue?", _
vbYesNo, "Caution") = vbNo Then
Exit Sub
End If

RBS
 
You can also declare it as VbMsgBoxResult and it will give you an
auto-complete list of allowable values when you press the equals sign.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

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