#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Running a macro

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by accident
(wiping out everything already done). Therefore, I want to add a pop-up box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be added
to the macro? Thanks in advance.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Running a macro

If you post it (your code)..........someone will help

Vaya con Dios,
Chuck, CABGx3



"Derek Upson - Pioneer" wrote:

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by accident
(wiping out everything already done). Therefore, I want to add a pop-up box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be added
to the macro? Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Running a macro

Maybe this

Sub clearrange()
msg = "Are you sure you want to clear range?"
response = MsgBox(msg, vbOKCancel)
If response = vbOK Then
'Do your stuff
MsgBox "You pressed OK"
Else
MsgBox "You pressed cancel"
Exit Sub
End If

End Sub

Mike

"Derek Upson - Pioneer" wrote:

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by accident
(wiping out everything already done). Therefore, I want to add a pop-up box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be added
to the macro? Thanks in advance.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Running a macro

i sent a reply with my excel spreadsheet attached and it did not go through.
are attachments restricted in this newsgroup?


"CLR" wrote in message
...
If you post it (your code)..........someone will help

Vaya con Dios,
Chuck, CABGx3



"Derek Upson - Pioneer" wrote:

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by
accident
(wiping out everything already done). Therefore, I want to add a pop-up
box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be
added
to the macro? Thanks in advance.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Running a macro

I don't know about "restricted", but they are not desired......just copy and
paste your code, or take a look at Mike's suggestion......

Vaya con Dios,
Chuck, CABGx3



"Derek Upson - Pioneer" wrote:

i sent a reply with my excel spreadsheet attached and it did not go through.
are attachments restricted in this newsgroup?


"CLR" wrote in message
...
If you post it (your code)..........someone will help

Vaya con Dios,
Chuck, CABGx3



"Derek Upson - Pioneer" wrote:

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by
accident
(wiping out everything already done). Therefore, I want to add a pop-up
box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be
added
to the macro? Thanks in advance.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Running a macro

sorry for my ignorance. However, below is what I have so far....where would
you suggest putting the code below and do I need to replace any of the words
in the code below with a reference to my existing code?

Sub ClearContents()
'
' ClearContents Macro
' Clear all Fields in Table
'

'
Range("I6:P6").Select
Selection.ClearContents
Range("I7:P7").Select
Selection.ClearContents
Range("I9:P9").Select
Selection.ClearContents
Range("I10:P10").Select
Selection.ClearContents
Range("I11:P11").Select
Selection.ClearContents
Range("I12:P12").Select
Selection.ClearContents
Range("I13:P13").Select
Selection.ClearContents
Range("U6:X6").Select
Selection.ClearContents
Range("U7:X7").Select
Selection.ClearContents
Range("U52:X52").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=12
Range("Q55:T55").Select
Selection.ClearContents
End Sub

"Mike H" wrote in message
...
Maybe this

Sub clearrange()
msg = "Are you sure you want to clear range?"
response = MsgBox(msg, vbOKCancel)
If response = vbOK Then
'Do your stuff
MsgBox "You pressed OK"
Else
MsgBox "You pressed cancel"
Exit Sub
End If

End Sub

Mike

"Derek Upson - Pioneer" wrote:

I have a spreadsheet model. Within the model are a bunch of fields
requiring input. I wanted to have a macro that would clear all of these
fields so someone could start over. That was the easy part. However, I
don't want someone to click on the button that starts the macro by
accident
(wiping out everything already done). Therefore, I want to add a pop-up
box
to the beginning of the macro that asks the user to verify that they want
all contents cleared. Can someone help me understand how this can be
added
to the macro? Thanks in advance.





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
Pop-up when running a macro tom Excel Discussion (Misc queries) 5 April 2nd 07 08:55 AM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
Running one macro from another Megadrone Excel Worksheet Functions 4 December 5th 06 04:54 AM
disable user running macro from Tools Macro Steve Simons Excel Discussion (Misc queries) 4 September 28th 06 06:28 AM
Running VBA Macro Jeff Excel Discussion (Misc queries) 1 February 15th 05 01:12 PM


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