Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I address in autofilter FIELD with a value in a cell?
Hi,
Is there a possibility to use other than FIELD:=41 in row below? Selection.AutoFilter Field:=41, Criteria1:="defined values" What I have in mind is that I would like to be able to define the heading cell value and use filtering in that column. All comments and adise is valuable. Thanks in advancd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Can I address in autofilter FIELD with a value in a cell?
Dim rng as Range, res as Variant
set rng = selection.Rows(1).Cells res = Application.Match("Header1",rng,0) if not iserror(res) then Selection.AutoFilter Field:=res, Criteria1:="defined values" else msgbox "header1 was not found" End if -- Regards, Tom Ogilvy "MakeLei" wrote: Hi, Is there a possibility to use other than FIELD:=41 in row below? Selection.AutoFilter Field:=41, Criteria1:="defined values" What I have in mind is that I would like to be able to define the heading cell value and use filtering in that column. All comments and adise is valuable. Thanks in advancd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic autofilter field | Excel Discussion (Misc queries) | |||
Summing a Field while Using an Autofilter | Excel Programming | |||
Selection.AutoFilter Field:=1 | Excel Programming | |||
VBA code to locate cell address of AutoFilter dropdown box | Excel Discussion (Misc queries) | |||
Format a Cell in Excel as an IP address field | Excel Discussion (Misc queries) |