Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Help: Autofilter doesn't work

I need to filter data in a sheet using a string as
criteria.

The problem I encountered is I get the string in this way:

Set mycell = Sheets("DPC").Range("Q3")

where in cell Q3 I insert a string key to perfom filtering.

If I use this code it obviously doesn't work, as it look
for "my_value" not for the value itself

Selection.AutoFilter Field:=3, Criteria1:="=my_value",
Operator:=xlAnd

Whay can I do?

Thanks Sebastian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Autofilter doesn't work

Set mycell = Sheets("DPC").Range("Q3")


Selection.AutoFilter Field:=3, Criteria1:= "=" & mycell.Value, _
Operator:=xlAnd

--
Regards,
Tom Ogilvy

"Sebastian" wrote in message
...
I need to filter data in a sheet using a string as
criteria.

The problem I encountered is I get the string in this way:

Set mycell = Sheets("DPC").Range("Q3")

where in cell Q3 I insert a string key to perfom filtering.

If I use this code it obviously doesn't work, as it look
for "my_value" not for the value itself

Selection.AutoFilter Field:=3, Criteria1:="=my_value",
Operator:=xlAnd

Whay can I do?

Thanks Sebastian



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Autofilter doesn't work

Thanks,

Sebastian


Selection.AutoFilter Field:=3, Criteria1:= "=" &

mycell.Value, _
Operator:=xlAnd

--
Regards,
Tom Ogilvy

"Sebastian" wrote in message
...
I need to filter data in a sheet using a string as
criteria.

The problem I encountered is I get the string in this

way:

Set mycell = Sheets("DPC").Range("Q3")

where in cell Q3 I insert a string key to perfom

filtering.

If I use this code it obviously doesn't work, as it look
for "my_value" not for the value itself

Selection.AutoFilter Field:=3, Criteria1:="=my_value",
Operator:=xlAnd

Whay can I do?

Thanks Sebastian



.

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
Autofilter doesn't work tombogman Excel Discussion (Misc queries) 7 January 18th 06 12:09 AM
custom autofilter does not work Max Excel Discussion (Misc queries) 2 January 13th 06 02:41 AM
SUBTOTAL(9,range) Does NOT work in AutoFilter Dane Excel Worksheet Functions 5 September 4th 05 06:06 PM
Autofilter on protected work book? Muppet Excel Discussion (Misc queries) 1 August 6th 05 08:56 AM
Autofilter(Top 10...): What does it do? How does it work? Chet Hurd Excel Discussion (Misc queries) 3 May 10th 05 08:24 PM


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