View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default List Box Visible Rows Only

Dim rng as Range
On Error Resume Next
set rng =
Range(Cells(6,1),Cells(rows.count,1).End(xlup)).Sp ecialCells(xlVisible)
On Error goto 0
if not rng is nothing then
for each cell in rng
listbox1.AddItem cell.Value
Next
End if
--
Regards,
Tom Ogilvy

"John Wilson" wrote in message
...
having some (a lot) of trouble with this.
I know it can be done and I think I've exausted my searches (and my
patience).

I have a list box on a UserForm

I need to fill the list box with a filtered range of data on the active
worksheet.
Header row is row 5.
Data starts on row 6
For example, after a filter, only rows (5), 6, 8 & 10 are visible.
How can I populate the list box with the data for columns A, B & C
with only rows 6, 8 & 10??

TIA,
John