Highlight a row in excel

nisha

Registered User.
Local time
Yesterday, 23:55
Joined
Aug 18, 2009
Messages
22
hi,

i am trying to validate the data in the excel by taking it in the rowset and looping through that. Now if i find any invalida data i want to highlight that particular row. How can i do this. ??
 
You would use entirerow.select

eg
Sheets("sheet1").Select
With ActiveSheet
.Cells.Range("a57").EntireRow.Select
End With

would highlight row 57
tailor this to your code.

Brian
 
Strangely the forum is not flagging up my 1st post.

Brian
 
If you wish to change the background colour of the row then

Sheets("sheet1").Cells.Range("a53").EntireRow.Interior.ColorIndex = 6

this makes all row53 yellow

Sheets("sheet1").Cells.Range("a50:j50").Interior.ColorIndex = 6

This makes the range quoted yellow
but more use to you I think will be the one below, or some mod of it, which makes the row of the active cell yellow

ActiveCell.EntireRow.Interior.ColorIndex = 6

Brian
 

Users who are viewing this thread

Back
Top Bottom