markkramer
Board Regular
- Joined
- May 8, 2002
- Messages
- 162
I’ve created a macro that sets the color of a selected cell as follows:
Range("K25").Select
ActiveCell.FormulaR1C1 = "Complete"
Selection.Interior.ColorIndex = 3
Selection.Font.ColorIndex = 2
The worksheet is protected but the cell to be updated is unlocked.
The goal is to set the cell shading to red and the text to white.
When the macro runs I receive “Run-time error 1004: Unable to set the ColorIndex property of the Interior class” and “Run-time error 1004: Unable to set the ColorIndex property of the Font class.”
If I don’t protect the worksheet, then the macro runs fine.
Does anyone have any ideas as to what may be causing the error messages and how I can accomplish my goal while maintaining the worksheet as protected?
Thanks!
Mark
Range("K25").Select
ActiveCell.FormulaR1C1 = "Complete"
Selection.Interior.ColorIndex = 3
Selection.Font.ColorIndex = 2
The worksheet is protected but the cell to be updated is unlocked.
The goal is to set the cell shading to red and the text to white.
When the macro runs I receive “Run-time error 1004: Unable to set the ColorIndex property of the Interior class” and “Run-time error 1004: Unable to set the ColorIndex property of the Font class.”
If I don’t protect the worksheet, then the macro runs fine.
Does anyone have any ideas as to what may be causing the error messages and how I can accomplish my goal while maintaining the worksheet as protected?
Thanks!
Mark