Protection using the subtotal function

G

Guest

Is it possible to protect a worksheet and still be able to use the subtotal
(grouping and ungrouping) function in excel? I need to protect a document but
be able to allow others to group/ungroup the data. Can this be done? Thanks,
 
G

Guest

Yes, it is possible with VBA. Copy the following code into a VBA module in
the workbook. Edit the sheet name ("Sheet1") and password ("hi") as
appropriate.

Option Explicit

Sub Auto_Open()
With Worksheets("Sheet1")
.Protect Password:="hi", UserInterfaceOnly:=True
.EnableSelection = xlNoSelection
.EnableOutlining = True
.EnableAutoFilter = True
End With
End Sub

Hope this helps,

Hutch
 

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