I am trying to lock certain cells in my workbook and to do that I am specifying the cells that I don't want it to lock and then protecting workbook.
This is my code,
MyWorkbook.Sheets(l).Range("A" & HeaderRow + 1 & ":B" & lastrow).Locked = False
MyWorkbook.Sheets(l).Protect Password:="201&", DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowFormattingCells:=True, AllowFiltering:=True, AllowFormattingColumns:=False
This code allows the end user to change the fonts of the cells that I have locked. But I want to allow cell formatting only where the cell editing is allowed.