Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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
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
Dynamic autofilter field merry_fay Excel Discussion (Misc queries) 2 March 17th 10 02:11 PM
Summing a Field while Using an Autofilter Lost and Looking for Help Excel Programming 1 May 24th 06 05:59 PM
Selection.AutoFilter Field:=1 MBlake[_2_] Excel Programming 7 August 25th 05 08:03 PM
VBA code to locate cell address of AutoFilter dropdown box Dennis Excel Discussion (Misc queries) 3 August 9th 05 10:00 PM
Format a Cell in Excel as an IP address field willvi Excel Discussion (Misc queries) 1 March 2nd 05 07:25 PM


All times are GMT +1. The time now is 05:45 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"