#1   Report Post  
Posted to microsoft.public.excel.misc
tom tom is offline
external usenet poster
 
Posts: 570
Default Warning Message

Prior to executing a Macro in a workbook, I would like a Warning message to
pop-up asking the user to verify they are wanting to run this macro.

TFTH,
Tom
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,670
Default Warning Message

Just include code in your macro that includes an OK/Cancel Box -- and have OK
be continue running, have cancel stop the macro there.

"tom" wrote:

Prior to executing a Macro in a workbook, I would like a Warning message to
pop-up asking the user to verify they are wanting to run this macro.

TFTH,
Tom

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Warning Message

Option Explicit
sub yourmacro()

resp = msgbox(Prompt:="wanna run this?", buttons:=vbyesno)

if resp = vbno then exit sub

....
end sub



tom wrote:

Prior to executing a Macro in a workbook, I would like a Warning message to
pop-up asking the user to verify they are wanting to run this macro.

TFTH,
Tom


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Warning Message


tom wrote:
Prior to executing a Macro in a workbook, I would like a Warning message to
pop-up asking the user to verify they are wanting to run this macro.

TFTH,
Tom


Hi Tom,

If you are able to edit each macro's code then you could have each
macro start off with these three lines...

Dim msgCheck As VbMsgBoxResult
msgCheck = MsgBox("Are you sure you want to blah blah?", vbYesNo)
If msgCheck = vbNo Then Exit Sub

Edit "blah blah" to something applicable to the macro's function.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Warning Message

Option Explicit
sub yourmacro()

dim resp as long '<-- I forgot this!

resp = msgbox(Prompt:="wanna run this?", buttons:=vbyesno)

if resp = vbno then exit sub

....
end sub

Dave Peterson wrote:

Option Explicit
sub yourmacro()

resp = msgbox(Prompt:="wanna run this?", buttons:=vbyesno)

if resp = vbno then exit sub

....
end sub

tom wrote:

Prior to executing a Macro in a workbook, I would like a Warning message to
pop-up asking the user to verify they are wanting to run this macro.

TFTH,
Tom


--

Dave Peterson


--

Dave Peterson
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
File in use error message on a non shared workbook James@ Excel Discussion (Misc queries) 3 November 9th 06 09:27 PM
error message when opening excel 2000 Lem Excel Discussion (Misc queries) 3 August 31st 06 11:06 PM
Simple message box question zeyneddine Excel Discussion (Misc queries) 4 August 23rd 06 06:08 PM
Message Input with link to different work sheet KPM New Users to Excel 0 February 4th 06 05:20 PM
Message Input with link to different work sheet paul New Users to Excel 0 February 4th 06 02:59 PM


All times are GMT +1. The time now is 02:37 AM.

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"