I want to highlight a row if column N is >1.00 and also if it is <0. I want to color it dull oranage ColorIndex = 40 and Pattern = xlSolid.
Is there a way.
I want to highlight a row if column N is >1.00 and also if it is <0. I want to color it dull oranage ColorIndex = 40 and Pattern = xlSolid.
Is there a way.
Try this macro. This is assuming the maximum rows to check for is static, i currently set it to 200. You can change it to any number you want. It will check the first two hundreds rows of Column N
sub col_N_check()
for i = 1 to 200
if ActiveSheet.Range("N"&i).Value > 1 and ActiveSheet.Range("N"&i).Value < 0 Then
ActiveSheet.Range("N"&i).Interior.ColorIndex = 40
ActiveSheet.Range("N"&i).Interior.Pattern = "xlSolid"
end if
next i
end sub
nothings happening. I don't get an error; I just see any results.
Originally Posted by slx
Opps use OR instead of And
and remove the quotations from "xlSolid"
That worked alittle. What it did was highlight that cell and only the ones greater than 1. It did nothing to the 0's.
Ur first msg said anything < 0, that would mean negative numbers. If you want to include 0, then you change it to = 0
Okay that worked. But how do I get it to hightlight the whole row. It is just highlighting the cell in column N.
This should make it select the row instead of the cell.
sub col_N_check()
dim curr_Row as string
for i = 1 to 200
if ActiveSheet.Range("N"&i).Value > 1 or ActiveSheet.Range("N"&i).Value = 0 Then
curr_Row = i & ":" & i
ActiveSheet.Range(curr_Row).Interior.ColorIndex = 40
ActiveSheet.Range(curr_Row).Interior.Pattern = "xlSolid"
end if
next i
end sub
Yea!!! It works wonderful. Thank you so much. That saves me about 5 minutes everyday.
Thank you.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks