Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto filter macro
I will like to crete a macro that will select the 2nd
column of the filter to apply even if I add more columns later on. So if I add more columns the autfilter will select the second column. Any ideas? Thanks again. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto filter macro
Field:=2 selects the second column in the autofilter range. Adding
columns to the left should have no effect. -- Regards, Tom Ogilvy Ali wrote in message ... I will like to crete a macro that will select the 2nd column of the filter to apply even if I add more columns later on. So if I add more columns the autfilter will select the second column. Any ideas? Thanks again. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto filter macro
My bad. I actually want that particular field no matter
what column it is in. So if I add another column it will still point to that particula field thanks again. -----Original Message----- Field:=2 selects the second column in the autofilter range. Adding columns to the left should have no effect. -- Regards, Tom Ogilvy Ali wrote in message ... I will like to crete a macro that will select the 2nd column of the filter to apply even if I add more columns later on. So if I add more columns the autfilter will select the second column. Any ideas? Thanks again. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Auto filter macro
If the header for that column is Cost (as an example), then
Dim res as Variant res = application.Match("Cost",Range("A1:IV1") if not iserror(res) then Range("A1").Autofilter Field:=res, . . . -- Regards, Tom Ogilvy "Ali" wrote in message ... My bad. I actually want that particular field no matter what column it is in. So if I add another column it will still point to that particula field thanks again. -----Original Message----- Field:=2 selects the second column in the autofilter range. Adding columns to the left should have no effect. -- Regards, Tom Ogilvy Ali wrote in message ... I will like to crete a macro that will select the 2nd column of the filter to apply even if I add more columns later on. So if I add more columns the autfilter will select the second column. Any ideas? Thanks again. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
auto filter within a macro | Excel Discussion (Misc queries) | |||
Auto-Filter within a Macro | Excel Discussion (Misc queries) | |||
Auto filter run from a macro will not do the same as when done manually. | Excel Discussion (Misc queries) | |||
Auto Filter Macro | Excel Discussion (Misc queries) | |||
Auto Filter in a macro | Excel Programming |