View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Henry Henry is offline
external usenet poster
 
Posts: 61
Default Auto Copy Macro?

Hi,

I have an macro that would protect the sheet and allow insert/delete columns
and rows, as follow,

Sub Auto_Open()
With Worksheets("Sheet 1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With

ActiveSheet.Protect DrawingObjects:=False, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingColumns:=True,
AllowInsertingRows _
:=True, AllowInsertingHyperlinks:=True, AllowDeletingColumns:=True, _
AllowDeletingRows:=True, AllowSorting:=True, AllowFiltering:=True, _
AllowUsingPivotTables:=True

End Sub

i would like to modify it so that when i duplicate "Sheet 1" to "Sheet 2",
"Sheet 3", Sheet 4".....and so on, the macro would still work on all sheets
that start with "Sheet", any idea?

Thanks