Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filter Macro with Cell reference


Hi there,

I'm having an issue with recording a macro for custom filter with cell
references. The macro doesn't record a generic reference, just the
cell value at the time of recording. I looked loooong and hard for the
solution here, but i just can't find it. The closest i have to the
answer i found here (courtsey Tom Ogilvy):-

Selection.AutoFilter Field:=1, Criteria1:="=*" & Range("M13").Value _
& "*"

I tried playing around with the above but come unstuck when trying to
do a less than or equals to.

I desperately need help to this solution to finish off a project before
the weekend's out. Please, please please with extra whipped cream
help.

Chris

P.s could someone explain what the * element of the code is for?


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=557087

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 36
Default Filter Macro with Cell reference

Dnia Thu, 29 Jun 2006 14:50:30 -0500, chris100 napisał(a):

[...]
Selection.AutoFilter Field:=1, Criteria1:="=*" & Range("M13").Value _
& "*"

I tried playing around with the above but come unstuck when trying to
do a less than or equals to.


Selection.AutoFilter Field:=1, Criteria1:="<=" & Range("M13").Value

[...]
P.s could someone explain what the * element of the code is for?


Look at this code:
Criteria1:="=*" & Range("M13").Value & "*"

If M13 equals to, let's say, "xyz", then this line expands to:
Criteria1:="=*xyz*"

which means "show all records that CONTAIN xyz in field 1"

In the same way you could write:

Criteria1:="=" & Range("M13").Value & "*"

whicg means: all records BEGINNING with xyz in field 1

etc, etc...

--
PL
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Filter Macro with Cell reference


Thanks Piotr,

Meant to post and say that it worked. Appreciate the reply.

Chris


--
chris100
------------------------------------------------------------------------
chris100's Profile: http://www.excelforum.com/member.php...o&userid=25166
View this thread: http://www.excelforum.com/showthread...hreadid=557087

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
reference cell from advanced filter Nathan Excel Worksheet Functions 3 March 26th 10 02:02 AM
Filter and show data based on a reference cell Stephen Hancock Excel Worksheet Functions 3 June 30th 06 07:53 PM
Cell reference in the auto filter custom list Andre Croteau Excel Discussion (Misc queries) 1 February 14th 06 02:03 PM
Macro cell reference help justaguyfromky Excel Programming 9 January 8th 05 05:43 PM
Microsoft Query - how to reference a cell value in a filter Dan Excel Programming 1 December 13th 03 01:28 AM


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