I wrote a simple VBA code to check if the value of a cell is negative and if it is negative, highlight it red. For some reason, I keep getting “run-time mismatch”. My code is
For x = 2 To 100
Set val3 = Worksheets("Summary").Cells(x, 9)
If val3.Value < 0 Then
Worksheets("Summary").Cells(x, 9).FontColorIndex = 3
End If
Next x
Column 9 (the column I am checking) is filled with dollar values. Thank you in advance for your help.
In your code, you’re simply missing a dot.
should be: