View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Msg Box in IF statement?

You might try something like the following:


Dim Resp As VbMsgBoxResult
Resp = MsgBox(prompt:="Do you want to do something?", Buttons:=vbYesNo)
If Resp = vbYes Then
' code if user clicked 'Yes'
Else
' code if user clicked 'No'
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)


"Elise148" wrote in message
...
Can I put a message box into an IF statement in VBA???