Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default VBA - Get array of filter values

I am developing a VBA program that will go through a filtered list and do
query on multiple columns. I need to create an array of the filter values
from several columns.

How do I create a list of the values for a given column?

Thanks for your help,

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default VBA - Get array of filter values

Hi Gary,

I am developing a VBA program that will go through a filtered list
and do query on multiple columns. I need to create an array of
the filter values from several columns.


How do I create a list of the values for a given column?



Dim arr As Variant
Dim i As Long

arr = Array("Pippo", "Pluto", "Papperino")

For i = LBound(arr) To Ubound(arr)
'Fa qualcosa, e.g.;
msgbox arr(i)
Next i






---
Regards,
Norman



"gary" wrote in message
...
I am developing a VBA program that will go through a filtered list and do
query on multiple columns. I need to create an array of the filter values
from several columns.

How do I create a list of the values for a given column?

Thanks for your help,

Gary



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default VBA - Get array of filter values

Are you looking for that list of unique items that you see when you use the
arrow on an autofiltered column?

If yes, you could use data|Filter|advance filter and filter to a new location (a
different worksheet). Debra Dalgleish shows how to do it manually:

http://www.contextures.com/xladvfilter01.html#FilterUR

You could record a macro when you did it manually if you need code.

======
An alternative, John Walkenbach shows how to fill a listbox with a unique list:
http://j-walk.com/ss/excel/tips/tip47.htm



gary wrote:

I am developing a VBA program that will go through a filtered list and do
query on multiple columns. I need to create an array of the filter values
from several columns.

How do I create a list of the values for a given column?

Thanks for your help,

Gary


--

Dave Peterson
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
Filter an array hntsignif Links and Linking in Excel 1 December 13th 08 12:48 PM
Array: Counting multiple values within array Trilux_nogo Excel Worksheet Functions 4 April 16th 07 03:12 AM
Advanced Filter for Values in Column M greater than Values in Colu SteveC Excel Discussion (Misc queries) 3 May 2nd 06 07:55 PM
Search/Filter to find values in another range based on two cell values Andy Excel Programming 2 April 29th 04 04:08 PM
How to set multiple filter values for a filter in the page fields Simon Lenn Excel Programming 1 December 29th 03 09:35 PM


All times are GMT +1. The time now is 11:40 AM.

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"