Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Allow formatting to a protected excel sheet

Status
Not open for further replies.

oggsta

Technical User
Jun 22, 2002
41
GB
I would like to allow the user to format (Bold and fill)those cells that are not locked in the protected sheet. Specifically to be able to Fill and bold cells, is anyone able to help on the resuired code to add to what is already below.

Any held appreciated. Thanks

ActiveSheet.protect password:="password"
 
I would allow the user to highlight the cells and give them a button.

Record a macro of you doing it and cut and paste the code to the button code. Start record, unprotect, select cells, protect, stop recording. delete the selection of cells code line(s).

Selection of a group of cells survives unprotect so the user can choose.
 
Thanks for the reply;

I tryed this and it did not seem to work as even those cels taht are not locked will not allow any formatting at all once the sheet has been protected.
 
Oggsta - read Cresby's post carefully:
"Start record, unprotect, select cells, protect, stop recording"

Cresby is suggesting you record yourself unprotecting the sheet, making the text bold and then re-protecting the sheet in code

attach this recorded code to a button and replace the range references with "Selection"

You will end up with something like this

Activesheet.unprotect password:="whatever"
selection.font.bold = true
activesheet.protect password:="whatever"
Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top