Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 43
Default Msg Box in IF statement?

Can I put a message box into an IF statement in VBA???
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,344
Default 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???

  #3   Report Post  
Posted to microsoft.public.excel.misc
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???


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
IF Statement Sue Excel Discussion (Misc queries) 3 February 24th 06 06:16 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 02:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"