LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Want to select row

I have code that loops through all rows, checks the value in a specific cell
and based on that value sets the fill color for that cell. I want to set the
fill color for the entire row. Ideally, the code would only set the fill
color for the columns I am using (columns A - M), but setting the fill color
for the entire row (beyond column N) would be better than what I have now.

Dim r As Range
Dim n As Integer
' Format_Status_Colors
Set r = Range("K1", Range("K65536").End(xlUp))
For n = 2 To r.Rows.Count
If r.Cells(n, 1) = "" Then
' Do nothing
ElseIf r.Cells(n, 1) = "Needs to be Validated" Then
r.Cells(n, 1).Select
With Selection.Interior
.ColorIndex = 37
.Pattern = xlSolid
End With
ElseIf r.Cells(n, 1) = "Validated" Then
r.Cells(n, 1).Select
With Selection.Interior
.ColorIndex = 35
.Pattern = xlSolid
End With
End If
Next n

Can anyone help me set the fill color for the row I am on, not just the cell?

Thank you,
Judy
 
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
VBA: Column Select then Data Select then return to cell A1 James C[_2_] Excel Discussion (Misc queries) 3 February 1st 10 11:35 AM
Macro to select cells without a certain value and select a menu it Guy[_2_] Excel Worksheet Functions 9 January 2nd 09 05:21 PM
Using formulas to select cells (Ex: Select every nth cell in a col Lakeview Photographic Services Excel Discussion (Misc queries) 2 March 15th 07 02:17 PM
End Select without Select Case, Block If without End If errors Atreides Excel Programming 12 November 17th 06 05:10 PM
Select other workbook to select data in a macro. T Tromp Excel Programming 2 September 19th 03 01:43 PM


All times are GMT +1. The time now is 11:07 PM.

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

About Us

"It's about Microsoft Excel"