Hello guys,
I am trying to program the event Worksheet_SelectionChange so that if a range of multiple cells is selected it searches and counts the number of cells that have either red text or red highlighting. This is what I have so far and it just doesn't do it:
I already declared cell as a range. This segment of code is part of an event macro with other code in it but the other code shouldn't interfere.
I am trying to program the event Worksheet_SelectionChange so that if a range of multiple cells is selected it searches and counts the number of cells that have either red text or red highlighting. This is what I have so far and it just doesn't do it:
Code:
'red text or highlighted red
For Each cell In Target
If cell.Font.Color = 255 Or cell.Interior.Color = 252 Then errorcounter = errorcounter + 1
Next cell