Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Multiple message boxes, one after the other in AutoOpen or other?

If I have interpretted your request properly.

Sub Auto_Open()
Dim MyMsgBox

MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKCancel + vbExclamation, "REMEMBER ...")


Select Case MyMsgBox
Case vbOK
'Your code here for OK
MsgBox "User selected OK"
Case vbCancel
MsgBox "User selected cancel"
Exit Sub
End Select


End Sub

--
Regards,

OssieMac


"StargateFan" wrote:

I can't find the answer to this one; perhaps I'm googling/searching
for the wrong search terms.

I have an AutoOpen script that works just great, but I need to string
at least one other message to it after pressing OK. (And cancel would
stop the boxes, naturally.)

Sub Auto_Open()
MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKOnly + vbExclamation, "REMEMBER ...")
End Sub

How could I tack on another message box, or perhaps 2, to the above?

Thank you! :oD


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Multiple message boxes, one after the other in AutoOpen or other?

I can't find the answer to this one; perhaps I'm googling/searching
for the wrong search terms.

I have an AutoOpen script that works just great, but I need to string
at least one other message to it after pressing OK. (And cancel would
stop the boxes, naturally.)

Sub Auto_Open()
MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKOnly + vbExclamation, "REMEMBER ...")
End Sub

How could I tack on another message box, or perhaps 2, to the above?

Thank you! :oD

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Multiple message boxes, one after the other in AutoOpen or other?

On Mon, 3 Aug 2009 19:10:01 -0700, OssieMac
wrote:

If I have interpretted your request properly.

Sub Auto_Open()
Dim MyMsgBox

MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKCancel + vbExclamation, "REMEMBER ...")


Select Case MyMsgBox
Case vbOK
'Your code here for OK
MsgBox "User selected OK"
Case vbCancel
MsgBox "User selected cancel"
Exit Sub
End Select


End Sub


<lol No, sorry. I really wasn't clear! Sorry 'bout that! <g
I have to do this better ...

Okay, I have a message box come up in AutoOpen. It works great but it
would be really helpful to give the user more information via another
message box or two, something like this:

AutoOpen: msg box comes up with OK and CANCEL.

If user presses OK, another message pops up, different from the first.
But it also has OK and CANCEL.

If user presses OK to that one, a third and final "reminder" or
message pops up. Here it can have just an OK button as CANCEL would
be superfluous <g.

If at any time, though, the user presses Cancel, no further message
boxes come up.

I hope I got it better this time. <g

Oh, should mention what the above does. It just regurgitates back to
user which button was pressed. When OK was pressed, a message box
comes up saying "User selected OK". When they press cancel, another
box pops up saying "User selected cancel". Nifty, but, um, not
exactly something that I can find a user for here <vbg.

Thanks! Much appreciated! :oD

--
Regards,

OssieMac


"StargateFan" wrote:

I can't find the answer to this one; perhaps I'm googling/searching
for the wrong search terms.

I have an AutoOpen script that works just great, but I need to string
at least one other message to it after pressing OK. (And cancel would
stop the boxes, naturally.)

Sub Auto_Open()
MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKOnly + vbExclamation, "REMEMBER ...")
End Sub

How could I tack on another message box, or perhaps 2, to the above?

Thank you! :oD



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,510
Default Multiple message boxes, one after the other in AutoOpen or oth

I was assuming that you knew enough to complete your task once I had given
you the idea of vbOkCancel etc. You will need to edit your messages in the
following for your first, second third msge etc. I have also used If/Else/End
If as an alternative way of doing it.

Sub Auto_Open()
Dim MyMsgBox
Dim MyMsgBox2
Dim MyMsgBox3

MyMsgBox = MsgBox("Script line 1." & vbCrLf & _
"Script line 2", _
vbOKCancel + vbExclamation, "REMEMBER ...")

If MyMsgBox = vbOK Then
MyMsgBox2 = MsgBox("2nd msge." & vbCrLf & _
"Script line 2", _
vbOKCancel + vbExclamation, "REMEMBER ...")

If MyMsgBox2 = vbOK Then
MyMsgBox3 = MsgBox("3rd msge." & vbCrLf & _
"Script line 2", _
vbOKOnly + vbExclamation, "REMEMBER ...")
Exit Sub
Else
Exit Sub
End If
Else
Exit Sub
End If

End Sub

--
Regards,

OssieMac


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
Message Boxes VoxBox-Richard Excel Programming 2 August 5th 08 10:32 PM
Multiple Lines in Message Boxes NickHK Excel Programming 0 November 15th 06 02:20 AM
Displaying Multiple values with message boxes Dani Excel Programming 1 January 10th 06 11:41 PM
Message Boxes. Donny Excel Programming 3 February 7th 05 06:50 PM
Message Boxes uplink600[_6_] Excel Programming 1 September 13th 04 11:23 AM


All times are GMT +1. The time now is 10:26 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"