I am a noob and ask forgivness... I have search high and low, but to no avail i have not been able to find what I am looking for..
I have a report that comes in a few different formats... the headers are not always in the same spot ( I have no control over that). One report the column may be in A10 and another may be in Z7... etc
I am looking to build a macro that will find the column named "OVLP_TYPE_**" (without quotes). Once that column is found i need to filter on that column for the term "CNC" (without quotes). I can then use the rest of the code i made to copy paste the results to another worksheet
any help would be great and if more info is needed please let me know
-g
Welcome to the Forum. Please read the Forum Rules and you will see that your thread title should not contain unnecessary words like Excel & macro.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
Something like his may do it
Code:Option Explicit Sub FindnFilter() Const sFind As String = "OVLP_TYPE_**" Const sCrit As String = "CNC" Dim Col As Long On Error GoTo notfound With ActiveSheet.UsedRange Col = .Find(sFind, LookIn:=xlValues).Column Selection.AutoFilter Field:=Col, Criteria1:=sCrit notfound: End With On Error GoTo 0 End Sub
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks