Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I program a message box with a (Yes),( No) buttons

How do I write an instruction in VB to generate a message box that askes for
a yes or no response?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 709
Default How do I program a message box with a (Yes),( No) buttons

DeJon, here is one way,

Sub Message_box_test()

Msg = "Put message here"
Title = "Put title here"
Response = MsgBox(Msg, vbYesNoCancel + vbQuestion, Title)

If Response = vbNo Then
'your code if no is clicked here
MsgBox "you clicked no"
Exit Sub ' Quit the macro
End If

If Response = vbCancel Then
'your code if Cancel is clicked here
MsgBox "You clicked cancelled"
Exit Sub ' Quit the macro
End If

'your code if Yes is clicked here
MsgBox "you clicked yes"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003

"DeJon" wrote in message
...
How do I write an instruction in VB to generate a message box that askes

for
a yes or no response?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How do I program a message box with a (Yes),( No) buttons


Here's a site for message boxes
http://www.excel-vba.com/vba-excel-message-box.htm


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=520900

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
Program Buttons in EXCEL Proc Print-SAS Excel Worksheet Functions 1 October 16th 06 09:21 PM
Add Message While Program is Working maperalia Excel Programming 7 April 22nd 06 04:16 AM
How to acknowledge a message box from VB program? Darwin Excel Programming 2 May 29th 04 02:15 PM
message box program flow losmac Excel Programming 0 August 21st 03 09:36 PM
message box program flow Chip Pearson Excel Programming 0 August 19th 03 09:54 PM


All times are GMT +1. The time now is 04:22 PM.

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

About Us

"It's about Microsoft Excel"