以下是将所选下拉列表值拉入excel的代码。但我想拉下该下拉列表的所有值。请帮助我,并提前感谢。
Array
(
[green] => avocado
[red] => apple
[yellow] => banana
)
答案 0 :(得分:1)
Dim x As Long
x = TypeOfChange.Options.Length
'Options is zero-based, so need to count from 0 to x-1
For i = 0 to x-1
Sheet1.Cells(i+1, "A").Value = TypeOfChange.Options(i).Text
'if you need the value for the option...
Sheet1.Cells(i+1, "B").Value = TypeOfChange.Options(i).Value
Next