View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default 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.