Shellgrip
09-16-2005, 05:36 AM
A friend (really!) asked me the other day if there was a way that cells could be filled with values dependent upon their fill colour, the result of simple conditional formatting. I said, sure, easy, of course.
The problem I'm seeing is that querying the value of ColorIndex on these cells that have been conditionally formatted (CF) always returns -4142 (which, I think, is the standard reply for an 'unfilled' cell. If the cells are filled 'manually' using the paint bucket - with the same colours - the code works fine.
We've checked, checked and triple checked. CF is definitely using the same colours as the manual filling. There's no weird palettes in use. The manually filled cells work fine so the code isn't at fault.
The best explanation I can offer is that it's as though the cells aren't really filled because it's the result of CF - as though the colour isn't really there.
Any logical explanation for this? http://vbaexpress.com/forum/images/smilies/119.gif
Jon
(Excel 2003 on XP Pro)
The problem I'm seeing is that querying the value of ColorIndex on these cells that have been conditionally formatted (CF) always returns -4142 (which, I think, is the standard reply for an 'unfilled' cell. If the cells are filled 'manually' using the paint bucket - with the same colours - the code works fine.
We've checked, checked and triple checked. CF is definitely using the same colours as the manual filling. There's no weird palettes in use. The manually filled cells work fine so the code isn't at fault.
The best explanation I can offer is that it's as though the cells aren't really filled because it's the result of CF - as though the colour isn't really there.
Any logical explanation for this? http://vbaexpress.com/forum/images/smilies/119.gif
Jon
(Excel 2003 on XP Pro)