ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Restrict Recorded Macro to a Particular Worksheet (https://www.excelbanter.com/excel-programming/371472-restrict-recorded-macro-particular-worksheet.html)

Invoice[_2_]

Restrict Recorded Macro to a Particular Worksheet
 
Recorded macros seem to be available in every worksheet. Is there a way I can
restrict them to a particular worksheet

Die_Another_Day

Restrict Recorded Macro to a Particular Worksheet
 
I'm not sure if you can make them not show in the macro list but you
can check the active sheet at the start of a macro like this
Sub Macro1()
If Not (ActiveWorkbook.Name = "YourWorkbook.xls" _
and ActiveSheet.Name = "YourWorksheet") Then Exit Sub
'Your Code
End Sub

Charles Chickering

Invoice wrote:
Recorded macros seem to be available in every worksheet. Is there a way I can
restrict them to a particular worksheet




All times are GMT +1. The time now is 04:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com