Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading data from a filtered list
I need some brain surgery, or the answer to the following:
I'd like to read two columns of data displayed by a filter into an array. Assume that the data is already filtered by column A when the file is opened. Cheers. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reading data from a filtered list
Dim vArr()
Dim maxnum as Long, i as Long Dim cell as Range maxnum = Activesheet.Autofilter.Range _ .columns(1).specialCells(xlVisible).Count - 1 if maxnum = 0 the exit sub redim varr(1 to maxnum, 1 to 2) i = 1 for each cell in ActiveSheet.Autofilter.Range.columns(1).Cells if cell.Row < ActiveSheet.Autofilter.Range.row then if cell.EntireRow.Hidden = False then varr(i,1) = cell.value varr(i,2) = cell.offset(0,1).Value i = i + 1 end if end if next Redim You could also use specialcells to get just the visible rows. this might be faster. -- Regards, Tom Ogilvy "Lucas Soler" wrote in message ... I need some brain surgery, or the answer to the following: I'd like to read two columns of data displayed by a filter into an array. Assume that the data is already filtered by column A when the file is opened. Cheers. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to bind filtered data in list box? | Excel Discussion (Misc queries) | |||
Dropdown list and filtered data | Excel Discussion (Misc queries) | |||
Getting data from a filtered list | Excel Discussion (Misc queries) | |||
Grabbing the filtered data in a list? | Excel Worksheet Functions | |||
Grabbing the filtered data in a list? | Excel Worksheet Functions |