将组合框(非ActiveX)中的所有单个项目返回到一系列单元格

时间:2017-11-18 13:59:29

标签: excel-vba combobox vba excel

我想将组合框中的所有项目返回到工作表中的一系列单元格,而无需单击组合框并选择其中的每个项目。可以这样做吗?以下代码仅返回下拉列表中的选定值

Sub drop_fetch()

Dim x As Integer
Dim nxt As Integer

nxt = Sheets("List").Range("F1").End(xlUp).Row + 1

' Populate Cells in Sheet with items in the combobox named "Drop"

For x = 1 To 10
    Sheets("List").Cells(nxt, 2).Value = Sheets("Selection By Market").DropDowns("Drop").List(Sheets("Selection By Market").DropDowns("Drop").ListIndex)
    nxt = nxt + 1
Next
End Sub

0 个答案:

没有答案