CZENHH
05-03-2011, 11:54 AM
I have a macro that pulls the S&P500 data.
A cell will have a value like this:
"Down 9.51 (.70%)"
or
"Up 4.51 (.36%)"
I want the font color to be red if down, green if up.
Sub changecolor()
If InStr(cells(18,10), "up") = "" Then
cells(18,10).Font.ColorIndex = 3
Else
cells(18,10).Font.ColorIndex = 4
End If
End sub
Thank you.
A cell will have a value like this:
"Down 9.51 (.70%)"
or
"Up 4.51 (.36%)"
I want the font color to be red if down, green if up.
Sub changecolor()
If InStr(cells(18,10), "up") = "" Then
cells(18,10).Font.ColorIndex = 3
Else
cells(18,10).Font.ColorIndex = 4
End If
End sub
Thank you.