modify macro to include more tabs

  • Thread starter Thread starter teh_chucksta
  • Start date Start date
T

teh_chucksta

Hi,

The macro below allows users to group/ungroup rows in a protected sheet. How
do I modify this macro to either incorporate more worksheets or apply it to
the entire workbook?

Thanks,
Charlie


Sub workbook_open()
With Worksheets("Sheet1")
.Protect Password:="password", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub
 
Try something like this, not tested

Sub workbook_open()
Dim wks as worksheet

For each wks in Activeworkbook
With wks)
.Protect Password:="password", userinterfaceonly:=True
.EnableOutlining = True
End With
next wks
End Sub

HTH
Peter
 
Back
Top