如何将选定的值从Excel列链接到用户窗体组合框 [英] How to link selected values from excel column to userform combobox
本文介绍了如何将选定的值从Excel列链接到用户窗体组合框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将excel列中的选定值链接到用户窗体组合框...
我在excel中有专栏...
像
这样的值
20
30
56
58
12
10
在这些中,我只想显示<组合框中的30个值
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
推荐答案
尝试:
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
这篇关于如何将选定的值从Excel列链接到用户窗体组合框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文