Display rows that meet condition

V

Vic

How can I display only rows with any cells from J thru BX highlighted in red?
I don't want to see other rows since they have no problems.
Row Cells: A-Country, B-Company, C-Product name, D-Product number. Cells E
thru I cannot be red. Any of the cells J thru BX may be hoghlighted in red.
BX is the last cell in the row.
Thank you.
 
L

Luke M

As you can't sort/filter on colors, perhaps you can tells us why the cells
are red? Do they meet some criteria, boundary condition, goal, etc?
 
J

Jacob Skaria

Hi Vic

Try the below macro which will hide all rows which are not highlighted. By
highligtion i assume you have used 'Fill Color' with (Red)...If you are new
to macros set the Security level to low/medium in (Tools|Macro|Security).
From workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module
and paste the below code. Save. Get back to Workbook. Run macro from
Tools|Macro|Run <selected macro()>


Sub HideRows()
Dim lngRow As Long, blnVisible As Boolean
Application.ScreenUpdating = False
For lngRow = 2 To Cells(Rows.Count, "A").End(xlUp).Row
blnVisible = False
For lngCol = 10 To 76
If Cells(lngRow, lngCol).Interior.ColorIndex = 3 Then _
blnVisible = True: Exit For
Next
Rows(lngRow).Hidden = Not blnVisible
Next
Application.ScreenUpdating = True
End Sub

If this post helps click Yes
 
V

Vic

Employees are instructed to highlight cells in red if there are issues. It is
not done programmatically. There may be more than one cell in a specific row
highlighted in red. I need rows that have at least one red cell. It is not
important how many red cells are in that row.
 

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