Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Macro automatically when a sheet is deleted
Hi,
I have a worksheet that contains 12 worksheets for different users to fill in. Each user will delete the other 11 worksheets and there will be an error message. Is there any way to solve this problem? Thank you very much. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Disable Macro automatically when a sheet is deleted
Your question is a little vague. You are in the programming group so you
could get code to delete the other sheets by assigning it to a toolbar. the code below will delete all but the active sheet. (No warning is given Sub DeleteAllButActive() Dim wksActive As Worksheet, wks As Worksheet Set wksActive = ActiveSheet Application.DisplayAlerts = False For Each wks In ThisWorkbook.Worksheets If wks.Name < wksActive.Name Then wks.Delete Next wks End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "bayhe" wrote in message ... Hi, I have a worksheet that contains 12 worksheets for different users to fill in. Each user will delete the other 11 worksheets and there will be an error message. Is there any way to solve this problem? Thank you very much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
My Posts are automatically getting deleted | Excel Discussion (Misc queries) | |||
Macro REQ: Automatically copy a template sheet and rename | Excel Worksheet Functions | |||
disable security warning when macros are deleted | Excel Discussion (Misc queries) | |||
Formula referencing deleted row (move up automatically) | Excel Worksheet Functions | |||
Disable Macro automatically when a sheet is deleted | Excel Programming |