the IF statement isn't working as it should
When something isn't working the way you expect, describe 1) What you expect 2) What is happening instead. I think you may have multiple issues tangled up here and I suspect that something you think is working is not actually working.
xlNone is for ColorIndex, not Color. ColorIndex is an index into the color palette, and has a value of 1-56. If it's value is xlNone, it means no color is assigned to that item. The value of xlNone is -4142.
Color is a Long number that represents the RGB value of the color from 0 - 16,777,215.
Therefore this condition
will always be False.
If you refer to the Interior.Color of a Range, and the cells in the range different colors, the value of Color will be 0. I don't know what your cells look like so I can't say if this is an issue with your worksheet.
In the second condition, you are not setting the color to "no color," you are setting it to solid fill with RGB(255, 255, 255) which is white. They are not the same thing. If you want to clear the color to "no color" use
The Color property will still be RGB(255,255,255) but the fill is cleared.
Also I strongly advise you to program without GoTo statements to the greatest extent possible. As it happens, in the code you showed here that GoTo has no effect anyway. If you deleted that line of code, the logic would still flow the same way.
Bookmarks