Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA code for Msgbox

Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like: go to
end sub)
Can anyone give me the code?

thanks.

Chris
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 449
Default VBA code for Msgbox

Hi Chris

Sub demo()
Select Case MsgBox("You really reaaly should save this " & _
"before the lengthy process", vbYesNoCancel + vbInformation)
Case vbYes
ActiveWorkbook.Save
Case vbNo
'do nada
Case vbCancel
Exit Sub
End Select
MsgBox "procedure here"
End Sub


HTH. Best wishes Harald

"Chris D" wrote in message
...
Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like: go to
end sub)
Can anyone give me the code?

thanks.

Chris


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default VBA code for Msgbox

If MsgBox("Calculating Takes a Moment, please wait. " & _
"Please save before continuing", vbOKCancel, "Proceed?") = vbOK Then
MsgBox "Save"
End If

--
HTH...

Jim Thomlinson


"Chris D" wrote:

Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like: go to
end sub)
Can anyone give me the code?

thanks.

Chris

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA code for Msgbox

Thanks guys, this works!

regards,

Chris

"Harald Staff" wrote:

Hi Chris

Sub demo()
Select Case MsgBox("You really reaaly should save this " & _
"before the lengthy process", vbYesNoCancel + vbInformation)
Case vbYes
ActiveWorkbook.Save
Case vbNo
'do nada
Case vbCancel
Exit Sub
End Select
MsgBox "procedure here"
End Sub


HTH. Best wishes Harald

"Chris D" wrote in message
...
Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like: go to
end sub)
Can anyone give me the code?

thanks.

Chris



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA code for Msgbox

Still 1 question: in the blue bar in the popupboxes the text " Microsoft
Excel" is mentioned. Is it possible to change this into something like " My
Toy"?

thanks.

Chris

"Chris D" wrote:

Thanks guys, this works!

regards,

Chris

"Harald Staff" wrote:

Hi Chris

Sub demo()
Select Case MsgBox("You really reaaly should save this " & _
"before the lengthy process", vbYesNoCancel + vbInformation)
Case vbYes
ActiveWorkbook.Save
Case vbNo
'do nada
Case vbCancel
Exit Sub
End Select
MsgBox "procedure here"
End Sub


HTH. Best wishes Harald

"Chris D" wrote in message
...
Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like: go to
end sub)
Can anyone give me the code?

thanks.

Chris





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VBA code for Msgbox

Add the optional 3rd argument (Title) to the MsgBox function call....

Select Case MsgBox("You really really should save this before " & _
"the lengthy process", vbYesNoCancel + vbInformation, "My Toy")

Rick


"Chris D" wrote in message
...
Still 1 question: in the blue bar in the popupboxes the text " Microsoft
Excel" is mentioned. Is it possible to change this into something like "
My
Toy"?

thanks.

Chris

"Chris D" wrote:

Thanks guys, this works!

regards,

Chris

"Harald Staff" wrote:

Hi Chris

Sub demo()
Select Case MsgBox("You really reaaly should save this " & _
"before the lengthy process", vbYesNoCancel + vbInformation)
Case vbYes
ActiveWorkbook.Save
Case vbNo
'do nada
Case vbCancel
Exit Sub
End Select
MsgBox "procedure here"
End Sub


HTH. Best wishes Harald

"Chris D" wrote in message
...
Hi,

I have the following code:
MsgBox "Calculating Takes a Moment, please wait...."

User has to press OK to proceed.
I would like to add under the existing line " please save file before
proceeding with this action, click Cancel to exit"
If the user selects "Cancel" then the sub is ended( somithing like:
go to
end sub)
Can anyone give me the code?

thanks.

Chris



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
VBA code for MsgBox Chris D[_2_] Excel Programming 7 June 2nd 08 07:32 AM
Msgbox Code Help Please.... kmwhitt Excel Discussion (Misc queries) 5 September 21st 06 01:52 AM
Code for MsgBox TimN Excel Programming 3 September 5th 06 05:53 PM
VBA code using if then and msgbox snoopy Excel Discussion (Misc queries) 0 December 1st 05 08:48 PM
syntax for code in MsgBox()? Ouka[_4_] Excel Programming 2 July 20th 05 05:18 PM


All times are GMT +1. The time now is 01:22 AM.

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"