Filter by specific header text

Milos

Board Regular
Joined
Aug 28, 2016
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to filter for blanks on a specific column header and I am struggling to get my head around it/could not find any solution on the net relevant for this issue. I need to use this on about 30 different sheets and every single worksheet has the same text ("Received Progress") in slightly different columns so setting which column is not feasible.

Ideally the code should look similar to this (albeit with the "Received Progress" probably converted into a Dim that will work correctly):

Code:
ActiveSheet.Rows(2).AutoFilter
ActiveSheet.Rows(2).AutoFilter Field = "[COLOR=#ff0000]Received Progress[/COLOR]", Criteria1:="="

Can anybody please help? It will save me a good 4 hours of applying filters.
Cheers,
Milos
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Try
Code:
   Dim fnd As Range
   Set fnd = Range("2:2").Find("Received Progress", , , xlWhole, , , False, , False)
   If Not fnd Is Nothing Then
      ActiveSheet.Rows(2).AutoFilter
      ActiveSheet.Rows(2).AutoFilter Field = fnd.column, Criteria1:="="
   End If
 
Upvote 0
Thanks Fluff!

I have added that into the rest of my code. Exactly what I needed!
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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