Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF not updating Barb Reinhardt Excel Programming 6 June 21st 07 08:15 PM
updating log kevatt[_21_] Excel Programming 0 March 6th 06 10:55 AM
updating log kevatt[_20_] Excel Programming 0 March 6th 06 10:43 AM
When updating a worksheet, how do I create a link updating the sa. Phlashh Excel Worksheet Functions 9 January 27th 05 06:05 PM
Updating Aaron Neunz Excel Programming 3 July 1st 04 04:55 PM


All times are GMT +1. The time now is 12:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"