Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用下面的代码初始化我的页面,以便它填充我的组合框。
For Each cell In rangeA If cell.Value <> "" Then ComboBox1.AddItem cell.Value Else End If Next
我有一个按钮来提示一个 msgbox,它将调用我的组合框中的所有项目。我该怎么做呢?提前致谢。
这可以按如下方式完成:
Private Sub ShowComboBoxAsMsgBox() Dim s As String Dim sep As String Dim i As Integer For i = 0 To Me.ComboBox1.ListCount - 1 s = s & sep & Me.ComboBox1.List(i) sep = vbCrLf Next i MsgBox s, vbInformation, "my ComboBox" End Sub