在EXCEL VBA用户窗口中增加组合框后,如何将表中某区域的值引用到组合框中?

2024-11-23 09:31:38
推荐回答(1个)
回答1:

Private Sub UserForm_Initialize()
ComboBox1.Clear
ComboBox1.Style = 2
For i = 1 To 10
ComboBox1.AddItem Sheets("Sheet1").Cells(i, 1).Value
Next i
ComboBox1.ListIndex = 0
End Sub