Range into ListBox excluding blanks
ps. The me keyword is the object that owns the code. In the sample code I
posted, it was the userform itself.
By using that keyword, I don't have to worry about the name of the userform. (I
did assume that it was a single userform--not that you were controlling two???)
KIM W wrote:
I successfully populate a listbox with a list of values based on the value
selected in a combox. The value in the combobox is a named range. However,
that list may have blanks in it that I don't want.
How can I display the listing in the listbox excluding any blanks so it is
one solid list? THe total items is less than 200, and often less than 20.
Private Sub ComboBox1_Change()
Dim rng As Variant
'rng = UserForm1.ComboBox1.Selected(x)
With ActiveSheet
rng = UserFormListToCell.ComboBox1.Value
UserFormListToCell.ListBox1.RowSource = rng
End With
End Sub
--
Dave Peterson
|