How to test for OK from a message Box

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All,

I want to do the following:

If Message Box = OK then
do this
Else
do that

I have tried various coding but can't seem to make it work.

I have seen this somewhere within the forums but all the searches I have
tried don't reveal the answer.

Any help greatly appreciated.

--
Cheers
Chas

***************
* Spectrum is Green *
***************
 
Lazy coding:

If MsbBox(...) = vbOK Then

Else

End if

but I prefer

Dim intResponse as Integet

intResponse = MsgBox (...)

If intResponse = vbOK Then
....
 
Dear Rob and Van,

Many thanks for the prompt answers.

Guess I'll just have to pick and choose but it looks like the second is
better as it give me a variable to play with.

Thanks again.
--
Cheers
Chas

***************
* Spectrum is Green *
***************
 

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