highlight a row if meets criteria

ghynes

Board Regular
Joined
Dec 21, 2004
Messages
96
can anyone tell me how to highlight a row in orange if a certain cells meets certain criteria?

every day i get a table of data and i want to be check every row and highlight
the row if C1 > 10.
the number of rows change every day and the number of columns change. thanks
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Select all the data, Format > Conditional Formatting, select Formula Is, enter

=$C1>10

Click the Format button, apply a format and click OK.
 
Upvote 0
can anyone tell me how to highlight a row in orange if a certain cells meets certain criteria?

every day i get a table of data and i want to be check every row and highlight
the row if C1 > 10.
the number of rows change every day and the number of columns change. thanks
See if this does what you want:

1. Select more rows than you are likely to need by clicking and dragging down the row labels.

2. Format|Conditional Formatting...|Condition 1|Formula is: =$C1>10|Format...|Patterns tab|select colour|OK|OK
 
Upvote 0
thanks for the replys. i should have put in the first post that im looking for vb macro code for it
 
Upvote 0
Try

Code:
Sub orange()
Dim LR As Long, i As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
    With Range("C" & i)
        If .Value > 10 Then .EntireRow.Interior.ColorIndex = 45
    End With
Next i
End Sub
 
Upvote 0
You could try a conditional format,

*** Please be careful using this approach, try on a COPY of your workbook ***
If you have a lot of data in the sheet it could cause excel to hang, it seems ok up to 2000 rows by 10 columns, that is the largest sheet I have to test on.

Do Ctrl + a to select the whole sheet, then apply a conditional format using the formula

=AND($C1>10,A1<>"")

Hope this helps

edit: didn't refresh before posting, but I'll leave it in case it's of use.
 
Upvote 0
Maybe this?

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> CF()<br>    <SPAN style="color:#00007F">With</SPAN> ActiveSheet<br>        .Cells.FormatConditions.Delete<br>        <SPAN style="color:#00007F">With</SPAN> .UsedRange<br>            .Cells(1, 1).Select<br>            .FormatConditions.Add Type:=xlExpression, Formula1:="=$C1>11"<br>            .FormatConditions(1).Interior.ColorIndex = 40<br>        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0
try this.

this vba script checks if each cell in column 3 is greater than 10 and highlights it in orange.

just make sure your data or heading is starting from cell c1 downwards.

Code:
Sub FormatThisSheet()
    Dim i As Integer
    i = 1
    Do While Worksheets(1).Cells(i, 3) <> ""
        If Worksheets(1).Cells(i, 3).Value > 10 Then
            Worksheets(1).Rows(i).Interior.ColorIndex = 45
        End If
        i = i + 1
    Loop
End Sub
 
Upvote 0
Try

Code:
Sub orange()
Dim LR As Long, i As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
For i = 1 To LR
    With Range("C" & i)
        If .Value > 10 Then .EntireRow.Interior.ColorIndex = 45
    End With
Next i
End Sub

this is highlighting everything. i run the F8 but it doesnt seem to be givng me a value of the cell
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top