#1   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 6
Default Advanced Filter

I am attempting to write a macro that incorporates an advanced filter
to search by ~100 criteria, across a list of ~200 columns x3000 rows.

Is there a way to implement this without running an advanced filter
with the same 100 criteria copied across 200 columns, one to match
each column in my list?

--Chris

  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 812
Default Advanced Filter

I'm not clear on what you are asking. In any case, some columns can
have no criteria.

Hth,
Merjet


  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 6
Default Advanced Filter

I would like to use advanced filters (or something similar) to
essentially do this:

Here are my 100 criteria, display every row that
contains one of them in the spreadsheet.



Currently all I know how to do is:

Here are my 100 criteria, display every instance of them
in a specific column

and repeat that for every single column, which with 200
columns makes for a very nasty advanced filter



Thanks in advance!

--Chris

  #4   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 8,856
Default Advanced Filter

Debra Dalgleish has some tips on using Advanced Filter he

http://www.contextures.com/xladvfilter02.html

Hope this helps.

Pete

On May 2, 3:50 pm, wrote:
I would like to use advanced filters (or something similar) to
essentially do this:

Here are my 100 criteria, display every row that
contains one of them in the spreadsheet.

Currently all I know how to do is:

Here are my 100 criteria, display every instance of them
in a specific column

and repeat that for every single column, which with 200
columns makes for a very nasty advanced filter

Thanks in advance!

--Chris



  #5   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 812
Default Advanced Filter

That's a little more specific. Alright, suppose A1:E10 is filled with
random numbers between 1 and 100, and you want to display a row only
if it contains one of the numbers in A13:D13. Then the folowing will
do that.

Sub MyFilter()
Dim rngCrit As Range
Dim c As Range
Dim bFound As Boolean
Dim iRow As Integer
Dim iCol As Integer
Dim ws As Worksheet

UndoMyFilter
Set ws = Sheets("Sheet1")
Set rngCrit = ws.Range("A13:D13")
For iRow = 1 To 10
bFound = False
For iCol = 1 To 5
For Each c In rngCrit
If ws.Cells(iRow, iCol) = c Then
bFound = True
Exit For
End If
Next c
Next iCol
If bFound = False Then ws.Rows(iRow).Hidden = True
Next iRow
End Sub

Sub UndoMyFilter()
Sheets("Sheet1").Rows("1:10").Hidden = False
End Sub

Hth,
Merjet




  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.excel.misc,microsoft.public.excel
external usenet poster
 
Posts: 6
Default Advanced Filter

That's perfect!!

Thanks for your help!

--Chris

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Filter - filter rows < jaws4518 Excel Discussion (Misc queries) 3 November 1st 06 05:48 PM
Why won't advanced filter return filter results? jaws4518 Excel Worksheet Functions 5 September 12th 06 06:11 PM
How do I use advanced filter to filter for blank cells? Monique Excel Discussion (Misc queries) 2 March 21st 06 06:43 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM
advanced filter won't allow me to filter on bracketed text (-456.2 LucianoG Excel Discussion (Misc queries) 1 December 6th 04 08:38 PM


All times are GMT +1. The time now is 03:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"