LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 395
Default AdvancedFilter syntax

Currently, I am using:

Sheet3.Range("A1:A10000").AdvancedFilter _
Action:=xlFilterCopy, _
CopyToRange:=Sheet2.Range("A1"), _
Unique:=True

This generates a list of the unique values from my source list. While I can
get to my real end result through several additional steps, I suspect that
I'm underutilizing AdvancedFilter, and am hoping for a few pointers on how to
get it to return some more specific information.

Specifically,
(1) I do have a criteria that I'd like to use without placing it in a cell
range (Select unique values from A1:A10000 where the corresponding value in
Column K is '4'). It appears that I can put the value 4 in a cell and
reference it, but can I just use a variable which is =4? If so, what is the
appropriate syntax?
e.g.,
CriteriaRange:= (Sheet1.range(K:K).value = 4)

(2) Ultimately, what I really want is a count of the unique values that meet
my criteria, so can I use a Count against the returned range, without sending
it to a physical page location? Perhaps I can make a named range that
references an array instead of a range, and use that to generate a count in a
second step?

Initially I was using formulas to get my unique counts, but using a
sumproduct formula (actually, several dozen of them) against an array this
large was just taking too long, and initial tests with AdvancedFilter
indicated it would be much faster.

I appreciate any syntax hints with the AdvancedFilter, or even confirmation
on whether or not what I'm attempting is even possible with AdvancedFilter.

My backup option is to just loop the page and sort the data into a 2D array
(while keeping track of whether each value is unique), but AdvancedFilter
seemed like a more direct option (no loops, etc)

Thank you,
Keith


 
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
Question about AdvancedFilter Paul B[_9_] Excel Programming 2 May 4th 09 01:07 AM
AdvancedFilter dannibrook Excel Programming 4 April 25th 06 11:19 AM
Advancedfilter ram Excel Programming 1 December 30th 05 02:18 AM
AdvancedFilter with VBA newToExcel Excel Programming 2 September 30th 05 05:20 PM
AdvancedFilter in VB loopy[_6_] Excel Programming 1 June 22nd 05 03:24 PM


All times are GMT +1. The time now is 10:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"