Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
pom pom is offline
external usenet poster
 
Posts: 7
Default Filter in macro

Hi

I'm trying to filter a table in a macro by the contents of a cell which is
outside the table range. (Basically, the user, on a separate sheet picks
from a list box what they want to filter by, and the results go into a linked
cell as usual). At present I am using AutoFilter, but can't seem to put the
cell reference in the Criteria1? Is it possible or am I using incorrect
syntax?

Any help would be great!
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Filter in macro

hi,
how do we know if your are using incorrect syntax unless
you post your code?

-----Original Message-----
Hi

I'm trying to filter a table in a macro by the contents

of a cell which is
outside the table range. (Basically, the user, on a

separate sheet picks
from a list box what they want to filter by, and the

results go into a linked
cell as usual). At present I am using AutoFilter, but

can't seem to put the
cell reference in the Criteria1? Is it possible or am I

using incorrect
syntax?

Any help would be great!
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
pom pom is offline
external usenet poster
 
Posts: 7
Default Filter in macro

you could just possibly tell me the correct syntax!


" wrote:

hi,
how do we know if your are using incorrect syntax unless
you post your code?

-----Original Message-----
Hi

I'm trying to filter a table in a macro by the contents

of a cell which is
outside the table range. (Basically, the user, on a

separate sheet picks
from a list box what they want to filter by, and the

results go into a linked
cell as usual). At present I am using AutoFilter, but

can't seem to put the
cell reference in the Criteria1? Is it possible or am I

using incorrect
syntax?

Any help would be great!
.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Filter in macro

Assume I record myself applying an autofilter. I get

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

for the criteria argument you could replace the "6" with the range where
the criteria is stored

Criteria1:=Range("M10").Text


--
Regards,
Tom Ogilvy


"POM" wrote in message
...
you could just possibly tell me the correct syntax!


" wrote:

hi,
how do we know if your are using incorrect syntax unless
you post your code?

-----Original Message-----
Hi

I'm trying to filter a table in a macro by the contents

of a cell which is
outside the table range. (Basically, the user, on a

separate sheet picks
from a list box what they want to filter by, and the

results go into a linked
cell as usual). At present I am using AutoFilter, but

can't seem to put the
cell reference in the Criteria1? Is it possible or am I

using incorrect
syntax?

Any help would be great!
.




  #5   Report Post  
Posted to microsoft.public.excel.programming
pom pom is offline
external usenet poster
 
Posts: 7
Default Filter in macro

Thanks for the help Tom - just what I needed!


"Tom Ogilvy" wrote:

Assume I record myself applying an autofilter. I get

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

for the criteria argument you could replace the "6" with the range where
the criteria is stored

Criteria1:=Range("M10").Text


--
Regards,
Tom Ogilvy


"POM" wrote in message
...
you could just possibly tell me the correct syntax!


" wrote:

hi,
how do we know if your are using incorrect syntax unless
you post your code?

-----Original Message-----
Hi

I'm trying to filter a table in a macro by the contents
of a cell which is
outside the table range. (Basically, the user, on a
separate sheet picks
from a list box what they want to filter by, and the
results go into a linked
cell as usual). At present I am using AutoFilter, but
can't seem to put the
cell reference in the Criteria1? Is it possible or am I
using incorrect
syntax?

Any help would be great!
.





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
macro filter puiuluipui Excel Discussion (Misc queries) 4 September 7th 09 01:18 PM
macro to filter puiuluipui Excel Discussion (Misc queries) 6 September 6th 09 02:43 PM
Macro Filter Blue Excel Worksheet Functions 2 May 26th 09 08:01 AM
how can this filter be done in a macro? Dave F Excel Discussion (Misc queries) 8 March 2nd 07 09:22 AM
Need a filter macro comotoman Excel Discussion (Misc queries) 0 October 6th 05 09:03 PM


All times are GMT +1. The time now is 11:49 PM.

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"