Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Next only updating one row
I am looking to change the font color to blue if the last update date (in
column 19) is greater than yesterday. I have the code below in the macro but it only runs for the row that is selected. It doesn't run through rows 2 to 1000. Any help is appreciated. For rwIndex = 2 To 1000 For colIndex = 19 To 19 With Worksheets("CC Routed Truck Loads").Cells(rwIndex, colIndex) If .Value = "" Then Exit For Else If .Value Int(Now()) - 3 Then Selection.EntireRow.Font.ColorIndex = 5 End If End If End With Next colIndex Next rwIndex |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Next only updating one row
Thanks to anyone who took a look at this, but I just realized I should remove the word Selection. Works fine now. "Gary McCarthy" wrote: I am looking to change the font color to blue if the last update date (in column 19) is greater than yesterday. I have the code below in the macro but it only runs for the row that is selected. It doesn't run through rows 2 to 1000. Any help is appreciated. For rwIndex = 2 To 1000 For colIndex = 19 To 19 With Worksheets("CC Routed Truck Loads").Cells(rwIndex, colIndex) If .Value = "" Then Exit For Else If .Value Int(Now()) - 3 Then Selection.EntireRow.Font.ColorIndex = 5 End If End If End With Next colIndex Next rwIndex |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
For Next only updating one row
If you have only ONE last update why look at all cells? Sub colorlastupateincol19() mc = 19 lr = Cells(Rows.Count, mc).End(xlUp).Row If Cells(lr, mc) Date - 1 Then rows(lr).font.ColorIndex = 5 End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "Gary McCarthy" wrote in message ... I am looking to change the font color to blue if the last update date (in column 19) is greater than yesterday. I have the code below in the macro but it only runs for the row that is selected. It doesn't run through rows 2 to 1000. Any help is appreciated. For rwIndex = 2 To 1000 For colIndex = 19 To 19 With Worksheets("CC Routed Truck Loads").Cells(rwIndex, colIndex) If .Value = "" Then Exit For Else If .Value Int(Now()) - 3 Then Selection.EntireRow.Font.ColorIndex = 5 End If End If End With Next colIndex Next rwIndex |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
UDF not updating | Excel Programming | |||
updating log | Excel Programming | |||
updating log | Excel Programming | |||
When updating a worksheet, how do I create a link updating the sa. | Excel Worksheet Functions | |||
Updating | Excel Programming |