Hide Row on Filter - May be challenging

fbacchus

Board Regular
Joined
Mar 14, 2002
Messages
56
Hi:

I am almost convinced that this cannot be accomplished or it would be difficult to accomplish. I would like to hide specific rows only when someone is filtering the data. I have several rows in my spreadsheet which I use for 'illustrative' purposes but if the user filters that data on any column, some of the 'illustrative' rows get included in the return set. I don't want this to happen - just the valid rows and not the 'illustrative' rows. The illustrative rows are in 'yellow' but I can tag them with a value (e.g. "1"), if need be as criteria for exclusion.

Thoughts?

frank
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
hopefully this is the right yellow :)

whatever column the yellow is in change as needed

Code:
Sub colour()
Dim LR As Long, i As Long
LR = Range("a" & Rows.Count).End(xlUp).Row
Application.ScreenUpdating = False
For i = LR To 1 Step -1
    If Range("a" & i).Interior.ColorIndex = 6 Then Rows(i).Hidden = True
Next i
Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top