Add a filtered range to a multicolumn ListBox

S

Spencer

I have a range("Products") with 4 coulmns of data. The range contains the
header row. The range will be filtered using standard auto filter by a
ComboBox on a userform. When the range is filtered, i need to be able to add
the filtered items to the multicolumn listbox and keep the header as the
listbox header. I can't get it to work right, tia.
 
S

Spencer

in case anyone is curious, her's how i did it. listbox name = "lbProducts"

For r = 2 To Range("Products").Rows.Count
If Range("Products").Rows(r).Height <> 0 Then
With Me.lbProducts
.AddItem Range("Products").Cells(r, 1).Value
.List(.ListCount - 1, 1) = Range("Products").Cells(r, 3).Value
.List(.ListCount - 1, 2) = FormatCurrency(Range("Products").
_
Cells(r, 2).Value, 2)
End With
End If
Next

note this is 3 columns with the thirs being a dollar value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top