Hi,
I got the following bit of code from this forum a few days ago:
Private Sub Worksheet_Calculate()
Dim TheRange As Range
Dim TheCell As Range
Set TheRange = Range("H8", Range("AK11"))
For Each TheCell In TheRange
If TheCell.Value < 0 Then
TheCell.Offset(-4, 0).Range("A1").Interior.ColorIndex = 3
ElseIf TheCell.Value = 0 Then
TheCell.Offset(-4, 0).Range("A1").Interior.ColorIndex = 6
ElseIf TheCell.Value >= 1 Then
TheCell.Offset(-4, 0).Range("A1").Interior.ColorIndex = 4
End If
Next TheCell
End Sub
It works beautifully. I was just wondering about the .value extension, as essentially I want to modify one of the following to check for the letter X, rather than a number
ElseIf TheCell.Value >= 1 Then
TheCell.Offset(-4, 0).Range("A1").Interior.ColorIndex = 4
Can I use the .Value extension or do I need to use another tag? I tried using
but it doesn't seem to work. What can I do? Is the >=1 bit the problem? If so, can I limit this to >=1 and <=99, and how can I do this?
Bookmarks