Click here to Skip to main content
15,918,808 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to link selected values from excel column to userform combobox...

I have a column in excel...
with value like
20
30
56
58
12
10

In these i want to show only < 30 value in the combo box
Posted
Comments
ZurdoDev 26-Dec-14 13:44pm    
Where are you stuck?

1 solution

Try:
VB
Privae Sub UserForm1_Initialize()
Dim wsh As Worksheet, i as Integer
Set wsh = ThisWorkBook.Worksheets("SheetName")
'define first row with data
i = 2
Do while wsh.Range("A" & i)<>""
    If wsh.Range("A" & i)<30 Then Me.ComboBox1.Items.Add wsh.Range("A" & i)
    i = i+1
Loop

Set wsh = Nothing
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900