![]() |
Msg Box in IF statement?
Can I put a message box into an IF statement in VBA???
|
Msg Box in IF statement?
Hi,
If [A1]1 then MsgBox "Hi" End if -- Cheers, Shane Devenshire "Elise148" wrote: Can I put a message box into an IF statement in VBA??? |
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??? |
All times are GMT +1. The time now is 07:24 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com