Highlight colored rows or columns in excel

S

sAMBEDAn kOIRALa

I need to select colored rows or columns in excel, I don't want to do
manually as it takes a lot of time. Does anyone know how to do it, any
macros that could do it?

Plz help

Rgds,
 
D

Dennis Tucker

The code below will put selection on a colored row. Its done in Excel 2000.
I don't think that the 2007 version uses ColorIndex any more.

This macro assumes you will take some sort of action on the
selected/highlighted rows.

Sub Macro1()

For MyRow = 2 To 200
' select the row, columns A to H in rows 2 to 200, one at a time
Range("A" + CStr(MyRow) + ":H" + CStr(MyRow)).Select
' if the fill color is red, then exit
If Selection.Interior.ColorIndex = 3 Then
' take some action
End If
Next MyRow

End Sub



Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top