modify macro to include more tabs

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
 
B

Billy Liddel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top