zoltix
asked on
vba: How to fill in combobox in excell from sheet ?
I have a sheet with a list of variables. How can i fill in this combo box with necessary inforatmion because the number of item can change with the time.
For example:
LOLO
LILI
LALA
[Empty]
[Empty]
......
......
......
I like have just LOLO LILI LALA
For example:
LOLO
LILI
LALA
[Empty]
[Empty]
......
......
......
I like have just LOLO LILI LALA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Dim I As Long
Dim b As Long
Dim c As String
If (Len(RTrim(LTrim(st))) = 0) Then Exit Sub
Do
st = LTrim(RTrim(st))
b = InStr(1, st, " ")
If (b <> 0) Then
c = Mid(st, 1, b - 1)
st = Mid(st, b, Len(st) - b + 1)
Else
c = st
End If
cb.AddItem c
Loop While b <> 0
End Sub