View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Display rows that meet condition

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
---------------
Jacob Skaria


"Vic" wrote:

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.