I am using a code fragment like this to set the background color of a cell:
Cells(x,y).Interior.ColorIndex = 6
The cell is not locked, to let the user change its value.
This works fine, until I protect the worksheet, with "allow all users to select unlocked cells". Then, when I run the program, I get the error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Runtime Error 1004
Unable to set the ColorIndex property of the Interior Class
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Why is this an error (although the sheet is protected, the cell is unlocked), and how can I work around this?
--
Ian
Bookmarks