Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I am looking for a simple msgbox which will pop up if there i nothing in a certain cell and ask the user if he wants to continue th macro. If he clicks Yes then code continues otherwise it stops. After looking in the VB help it only shows the following code but i seems far too messy for what I need. Can anyone help with a simple version please. ----------- Dim Msg, Style, Title, Help, Ctxt, Response, MyString Msg = "Do you want to continue ?" ' Define message. Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons. Title = "MsgBox Demonstration" ' Define title. Help = "DEMO.HLP" ' Define Help file. Ctxt = 1000 ' Define topic ' context. ' Display message. Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then ' User chose Yes. MyString = "Yes" ' Perform some action. Else ' User chose No. MyString = "No" ' Perform some action. End If ------------- -- johncassel ----------------------------------------------------------------------- johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501 View this thread: http://www.excelforum.com/showthread.php?threadid=51526 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi John,
'============= Public Sub TesterD001() Dim res As Long res = MsgBox("Do you wish to continue", vbYesNo) If res = vbYes Then ' Your processing code End If End Sub '<<============= --- Regards, Norman "johncassell" wrote in message ... Hello, I am looking for a simple msgbox which will pop up if there is nothing in a certain cell and ask the user if he wants to continue the macro. If he clicks Yes then code continues otherwise it stops. After looking in the VB help it only shows the following code but it seems far too messy for what I need. Can anyone help with a simpler version please. ----------- Dim Msg, Style, Title, Help, Ctxt, Response, MyString Msg = "Do you want to continue ?" ' Define message. Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons. Title = "MsgBox Demonstration" ' Define title. Help = "DEMO.HLP" ' Define Help file. Ctxt = 1000 ' Define topic ' context. ' Display message. Response = MsgBox(Msg, Style, Title, Help, Ctxt) If Response = vbYes Then ' User chose Yes. MyString = "Yes" ' Perform some action. Else ' User chose No. MyString = "No" ' Perform some action. End If -------------- -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=515260 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Cheers for that Norman, looks much neater. Thanks again John -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=515260 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
simple Macro needed | New Users to Excel | |||
A simple inputbox & responding msgbox coding | Excel Discussion (Misc queries) | |||
Help needed in a simple task | Excel Discussion (Misc queries) | |||
help needed with msgbox | Excel Programming | |||
simple help needed please | Excel Programming |