I have a VBA routine (Excel 2010) which tests the font colour in a cell using the expression
Range(“Cell”).Font.ColorIndex
This works fine except when there are two font colours in one cell I get a VBA error:
Run time error ’94’ invalid use of Null
Well that wasn’t totally unexpected so I thought I would trap this condition using the IsError function in VBA
However the expression . . .
IsError(Range(“Cell”).Font.ColorIndex)
. . . returns the value False
So is this an error or not ? The IsError function thinks it isn’t and VBA runtime thinks it is !
How can I test for this two-colour condition without getting a VBA error ?
Thanks for any ideas.
Martin