Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA: determine if value is invisible in autofilter

Hi,

I am looking for a vba solution to put de values of a selected range on a
worksheet into an array, listbox or combobox. The issue is as follows:

When a user uses the autofilter to produce a filtered list and subsequently
selects and copys a range then only the values of the cells that were visible
after the autofilter was set will be copied.
However when i select a filtered range and then execute a procedure that
puts the value of each of de cells in the selected range into a listbox, then
also values that where not visible when the autofilter was set will be put
into the listbox (or array or combobox).

so to better formulate my question:

When i am using a for each loop from say row 1 to row 20 to put each value
in column A into a listbox, how can i exclude those values that are not
visible when autofilter is set?

Thanx a lot!

Tamar
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default VBA: determine if value is invisible in autofilter

Let's say your range is in myRange.

for each r in myRange
if not r.entirerow.hidden then
'Put what you'd do if the row wasn't hidden
end if
next r


"Tamar" wrote:

Hi,

I am looking for a vba solution to put de values of a selected range on a
worksheet into an array, listbox or combobox. The issue is as follows:

When a user uses the autofilter to produce a filtered list and subsequently
selects and copys a range then only the values of the cells that were visible
after the autofilter was set will be copied.
However when i select a filtered range and then execute a procedure that
puts the value of each of de cells in the selected range into a listbox, then
also values that where not visible when the autofilter was set will be put
into the listbox (or array or combobox).

so to better formulate my question:

When i am using a for each loop from say row 1 to row 20 to put each value
in column A into a listbox, how can i exclude those values that are not
visible when autofilter is set?

Thanx a lot!

Tamar

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default VBA: determine if value is invisible in autofilter

Dear Barb Reinhardt,

thanx for your response, you helped me a lot!

i made the unfortunate assumtion that the hidden property of a row that is
hidden is different from a property that makes a filtered row hidden.

greetz,

Tamar

"Barb Reinhardt" wrote:

Let's say your range is in myRange.

for each r in myRange
if not r.entirerow.hidden then
'Put what you'd do if the row wasn't hidden
end if
next r


"Tamar" wrote:

Hi,

I am looking for a vba solution to put de values of a selected range on a
worksheet into an array, listbox or combobox. The issue is as follows:

When a user uses the autofilter to produce a filtered list and subsequently
selects and copys a range then only the values of the cells that were visible
after the autofilter was set will be copied.
However when i select a filtered range and then execute a procedure that
puts the value of each of de cells in the selected range into a listbox, then
also values that where not visible when the autofilter was set will be put
into the listbox (or array or combobox).

so to better formulate my question:

When i am using a for each loop from say row 1 to row 20 to put each value
in column A into a listbox, how can i exclude those values that are not
visible when autofilter is set?

Thanx a lot!

Tamar

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
excel 2007 autofilter change to 2003 autofilter functionality? jonnybrovo815 Excel Discussion (Misc queries) 1 April 19th 10 10:05 PM
AutoFilter - How to determine number of records found JRB Excel Programming 3 November 3rd 06 12:51 PM
determine if autofilter is on geebee Excel Programming 1 October 27th 06 11:06 PM
Determine Value of Autofilter Evan Excel Discussion (Misc queries) 1 June 1st 05 01:02 PM
Invisible AutoFilter Drop-Down Arrows Brian Arnold Excel Programming 3 July 30th 04 07:51 PM


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