Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teresa
 
Posts: n/a
Default Add a warning popup to a Macro Button

I have created a button and assigned a recorded macro to it that clears the
contents of the entire worksheet - however I've had a second thought & now
want a warning to popup when the button is clicked that the person has to
click through before the macro will run - kind of like the old "Are you
sure?" message. How can I do this with very limited knowledge?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Add a warning popup to a Macro Button

Dim ans as long

ans = MsgBox("Are you sure?, vbYesNo)
if ans = vbYes Then
... your code
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Teresa" wrote in message
...
I have created a button and assigned a recorded macro to it that clears

the
contents of the entire worksheet - however I've had a second thought & now
want a warning to popup when the button is clicked that the person has to
click through before the macro will run - kind of like the old "Are you
sure?" message. How can I do this with very limited knowledge?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
paul
 
Posts: n/a
Default Add a warning popup to a Macro Button

else exit sub
End If
??
--
paul
remove nospam for email addy!



"Bob Phillips" wrote:

Dim ans as long

ans = MsgBox("Are you sure?, vbYesNo)
if ans = vbYes Then
... your code
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Teresa" wrote in message
...
I have created a button and assigned a recorded macro to it that clears

the
contents of the entire worksheet - however I've had a second thought & now
want a warning to popup when the button is clicked that the person has to
click through before the macro will run - kind of like the old "Are you
sure?" message. How can I do this with very limited knowledge?




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teresa
 
Posts: n/a
Default Add a warning popup to a Macro Button

Hi

Thanks for this - however I'm a complete novice - what am I supposed to do
with it?

Kind regards

Teresa

"Bob Phillips" wrote:

Dim ans as long

ans = MsgBox("Are you sure?, vbYesNo)
if ans = vbYes Then
... your code
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Teresa" wrote in message
...
I have created a button and assigned a recorded macro to it that clears

the
contents of the entire worksheet - however I've had a second thought & now
want a warning to popup when the button is clicked that the person has to
click through before the macro will run - kind of like the old "Are you
sure?" message. How can I do this with very limited knowledge?




  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Teresa
 
Posts: n/a
Default Add a warning popup to a Macro Button

Hi

Thanks for this - however I'm a complete novice - what am I supposed to do
with it?

Kind regards

Teresa

"paul" wrote:

else exit sub
End If
??
--
paul
remove nospam for email addy!



"Bob Phillips" wrote:

Dim ans as long

ans = MsgBox("Are you sure?, vbYesNo)
if ans = vbYes Then
... your code
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Teresa" wrote in message
...
I have created a button and assigned a recorded macro to it that clears

the
contents of the entire worksheet - however I've had a second thought & now
want a warning to popup when the button is clicked that the person has to
click through before the macro will run - kind of like the old "Are you
sure?" message. How can I do this with very limited knowledge?




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
how to create a command button, then assign macro to it in excel kshaheen Excel Discussion (Misc queries) 3 June 24th 08 01:03 PM
Assign a macro to Command Button Object dallin Excel Discussion (Misc queries) 2 July 13th 05 03:50 AM
Macro Button Maggie Excel Discussion (Misc queries) 3 June 28th 05 04:29 AM
Attaching a macro to a VB button on a form WildGlio Excel Worksheet Functions 2 March 25th 05 11:11 PM
Assigning a macro to a "button" Yvon Excel Discussion (Misc queries) 6 February 8th 05 10:58 PM


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