L
Loomah
Hi All
I have the following code to attempt to populate a listbox from a filtered
list (Auto Filter, 2 columns) but it fails if there is a filter in place and
only uses the first Area in populating the ListBox
Private Sub UserForm_Initialize()
'(failed) attempts to take data from a filtered list
'and use it to populate a 2 column listbox
Dim myArray() As Variant
'attempt to write values into array
'fails as only first area is written into array
myArray = Worksheets(1).Range("A2:b" & _
Cells(65536, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Value
With Me.ListBox1
'make 2 columns in listbox
.ColumnCount = 2
'populate
.List() = myArray
End With
End Sub
any help, pointers, suggestions greatly appreciated
TIA
I have the following code to attempt to populate a listbox from a filtered
list (Auto Filter, 2 columns) but it fails if there is a filter in place and
only uses the first Area in populating the ListBox
Private Sub UserForm_Initialize()
'(failed) attempts to take data from a filtered list
'and use it to populate a 2 column listbox
Dim myArray() As Variant
'attempt to write values into array
'fails as only first area is written into array
myArray = Worksheets(1).Range("A2:b" & _
Cells(65536, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Value
With Me.ListBox1
'make 2 columns in listbox
.ColumnCount = 2
'populate
.List() = myArray
End With
End Sub
any help, pointers, suggestions greatly appreciated
TIA