Conditional statement

A

anamarie30

I need to include in this conditional statement that when a person enter in
the cell an "N/A" instead of a numerical value, the cell color remain with
interior color 8 (cell.Interior.ColorIndex = 8). But now what my macro do is
that for "N/A" value in the cell, automatically change the cell color to red
(cell.Interior.ColorIndex = 3). How can I rewrite my condition statement for
make it this true. My code is as follow:

If cell.Value > 183 Then
MsgBox "Down Time Change Over Goal (Goal = 183 min)!"
cell.Interior.ColorIndex = 3
Else
cell.Interior.ColorIndex = 8
End If
 
A

anamarie30

I already resolve the problem but for benefic of everyone else, I will share
it.

If cell.Value = "N/A" Then
cell.Interior.ColorIndex = 8
ElseIf cell.Value > 183 Then
MsgBox "Down Time Change Over Goal (Goal = 183 min)!"
cell.Interior.ColorIndex = 3
ElseIf cell.Value <= 183 Then
cell.Interior.ColorIndex = 8
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top