View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default Limit Macro to Intended worksheet.

one way:

Public Sub MyMacro
If ActiveSheet.Name < "Safe" Then Exit Sub
'<rest of your macro here
End Sub

In article ,
Quin wrote:

Is there a way to limit a macro to work only on ONE work sheet? When I
record a macro I only see an option to store in a WORKBOOK but not a work
sheet.

The problem I have is my macro will distroy my worksheet if I hit the
shortcut key while the wrong worksheet tab is selected. With multiple macros
and multiple worksheets it is only a matter of time before I hit the shortcut
key and get unintended results!

Quin

 
ExcelBanter Database Error
Database Error Database error
The ExcelBanter database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.excelbanter.com home page, then try to open another page.
  • Click the Back button to try another link.
The www.excelbanter.com forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.