Forum Discussion
jragan
Oct 27, 2021Copper Contributor
1004 error application-defined or object-defined error......Cannot figure out why
I have code that clears changes the color index of a cell. When I execute the code on a Workbook that I just opened and select the sheet I get the 1004 error on the first range statement below. Does...
- Oct 27, 2021
By default, cells on a protected sheet cannot be formatted.
One solution is tick the check box 'Format Cells' in the 'Protect Sheet' dialog when you protect the sheet.
Another is to temporarily unprotect the sheet:
... ActiveSheet.Unprotect Password:="secret" Range("J4").Font.ColorIndex = 2 Range("B7").Font.ColorIndex = 1 ActiveSheet.Protect Password:="secret"
HansVogelaar
Oct 27, 2021MVP
Has the Measurement Form worksheet been protected?
- jraganOct 27, 2021Copper ContributorYes
- HansVogelaarOct 27, 2021MVP
By default, cells on a protected sheet cannot be formatted.
One solution is tick the check box 'Format Cells' in the 'Protect Sheet' dialog when you protect the sheet.
Another is to temporarily unprotect the sheet:
... ActiveSheet.Unprotect Password:="secret" Range("J4").Font.ColorIndex = 2 Range("B7").Font.ColorIndex = 1 ActiveSheet.Protect Password:="secret"
- jraganOct 27, 2021Copper ContributorThank you very much!!!!