erxample.
a sheet is named DataSheet o which I have a Table range named 'DataBase'
On "sheet1" I have my Criteria range named 'Filter.Criteria' and an extract
header row named 'Filter.Extract'
The code below fetches the data to sheet1
The advamtage? well, you can select on multiple criteria PLUS you still get
to use the auto filter on the result set !
Sub CreateDataFilter()
With Worksheets("sheet1")
Range("DataBase").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=.Range _
("Filter.Criteria"), CopyToRange:=.Range("Filter.Extract"),
Unique:=False
End With
End Sub
http://www.xl-expert.com/Files/Filters.xls
"minostrada" wrote:
Patrick,
thanks for your reaction. ofcourse the best is for everybody different, my
fault! But a advanced filter may not be the right one because you should also
could filter on the result, for example:
my database is a inventory of products over the different departments, so
it's also useful to filter at every product in particular.
maybe with this information you help me with a code of advanced filter tips?
with regards,
rens
"Patrick Molloy" wrote:
the "best" code is undefinable - code that does a job , and does it well,
could be defined as good - but for any problem, there will be probably many
soulutions. Th e'best' may the solution that suits the user, but everyone has
different tastes. My car is colored 'solar yellow' which I think is the best
color for it. see?
What you could use is an Advanced Filter. This gives much better control
over what comes out of the filters.
"minostrada" wrote:
hi,
I'm building a database in Excel. At the moment I use a autofilter. But the
database got so many possibilities that I'm trying to write a VB code to hide
the empty columns out of the filtered results.
Does anybody know what the best code is?
thanks for so far!