0
我是vba excel的新手,我已经成功地添加了一个依赖于下拉列表选择的条件组合框,我面对的问题是每当我点击组合框中的任何项时,在点击后没有出现在框中。ComboBox选择中的问题
任何人都可以请帮我解决这个问题。
谢谢
我使用的代码是:
Private Sub ComboBox1_DropButtonClick()
ComboBox1.Clear
If Worksheets("Sheet1").Cells(2, 1).Value = "PHE" Then
With ComboBox1
For row = 1 To 1300
.AddItem Sheets("Sheet2").Cells(row, 6)
Next row
End With
End If
If Worksheets("Sheet1").Cells(2, 1).Value = "HSS" Then
With ComboBox1
For row = 2 To 56
.AddItem Sheets("Sheet2").Cells(row, 8)
Next row
End With
End If
If Worksheets("Sheet1").Cells(2, 1).Value = "Decanter" Then
With ComboBox1
For row = 3 To 249
.AddItem Sheets("Sheet2").Cells(row, 9)
Next row
End With
End If
End Sub
谢谢你一个更干净的代码,但你能告诉我如何直接在我们的“点击”的ComboBox1.Value =东西 – 2013-04-09 05:31:27
这是组合框的值,我们怎么能在其上组合框项目我们点击以显示在组合框中。请帮忙 – 2013-04-09 05:33:42