I would guess you need to have two separate if statements instead of elseif's.
Could describe in more detail what you are doing and the logic behind your code. I'm not sure I follow your reasoning for using a macro to change the cell colour - do you just want to highlight all the grey cells based on a condition and then delete all the grey cells? Can't you just delete all the cells that meet your condition?
I was originally using Conditional formatting, so based on a fields value, I wanted to change the background of another field. For instance, if B13 = "SC Bob", I wanted to change B20's field to a gray background. The problem with this was, I later wanted to be able to clear the contents of this field, so I wrote a macro
However, Excel doesn't recongnize Conditional Formatting as actually changing the Interior.ColorIndex, so I was seeing it as Gray, although the ColorIndex was still -4142 (No Fill), so I had to write VBA code to do my conditional formatting so it would ACTUALLY change the colorindex.
EDIT: I also tried doing If instead of ElseIf and it didn't change B71/B72 and it only messed up B59/B60 as it made both cases (III and Other) gray
Bookmarks