Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm not a big fan of changing conditional formatting with code unless you are
developing a new sheet and you don't plan to manipulate the data thru code, but you still can. So in your case I would just use this. Hope this helps! If so, let me know, click "YES" below. Sub MarkThem() Dim MyRange As Range Dim rng As Range Set MyRange = Range("I1:I" & Cells(Rows.Count, "I").End(xlUp).Row) For Each rng In MyRange If rng.Value < Date - 90 Then Range(Cells(rng.Row, "A"), Cells(rng.Row, "J")).Interior.Color = 65535 Else Range(Cells(rng.Row, "A"), Cells(rng.Row, "J")).Interior.Color = xlNone End If Next rng End Sub -- Cheers, Ryan "Rookie_User" wrote: I currently have the below to highlight the cell based on a condition of comparing a date in column (I) and if it's greater than 90 days past then highlight the cell - what I need to do is highlight the row from columns A-J, any idea's? This has to be programmed and if there is a better structure then I am open to it. Sub MarkThem() Range("I1").Select Range(Selection, Selection.End(xlDown)).Select Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlLessEqual, _ Formula1:="=NOW()-90" Selection.FormatConditions(Selection.FormatConditi ons.Count).SetFirstPriority With Selection.FormatConditions(1).Interior .PatternColorIndex = xlAutomatic .Color = 65535 .TintAndShade = 0 End With End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to use the Stop If True Condition for highlight cells | Excel Worksheet Functions | |||
highlight the row if meets the condition | Excel Worksheet Functions | |||
Conditional Format to highlight entire row if a condition is met | Excel Worksheet Functions | |||
Highlight row if condition is met | Excel Programming | |||
Formulas to highlight cell if condition is met | Excel Discussion (Misc queries) |