Change cell color in protected sheet

A

ansa

I have a worksheet where some cells are locked and the whole sheet is
protected. The users should be able to:
1. Enter data into the cells that are not locked
2. Group and ungroup
3. Filter
4. Change the color of the cells that are not locked

1 is not a problem, 2 and 3 is possible thanks to the code below (that I got
help with at this excellent forum!), but how do I solve 4? When I protect the
sheet I check all the boxes under "Tools/Protection/Protect sheet" including
"Format cells" but if I close and reopen the workbook it is no longer
possible to format the cells (at least not the color). I have Excel 2003. I
guess I should add some line to the code below to enable the color change but
what?

Private Sub Workbook_Open()
With Worksheets("my sheet name")
.EnableOutlining = True
.EnableAutoFilter = True
.Protect Password:="my password", _
Contents:=True, UserInterfaceOnly:=True
End With
End Sub

Greatful for all help,
Ansa
 
S

Stefi

Private Sub Workbook_Open()
With Worksheets("my sheet name")
.EnableOutlining = True
.EnableAutoFilter = True
.Protect Password:="my password", _
Contents:=True, UserInterfaceOnly:=True, _
AllowFormattingCells:=True

End With
End Sub


Regards,
Stefi

„ansa†ezt írta:
 

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