问题
Not sure why this seemingly simple piece of code keeps crashing excel for me:
Dim i as Long
For i = 0.25 to 10 step 0.25
me.combobox1.addItem (i)
Next i
Seems pretty straight forward, I want my combobox to have a list that looks as such:
0.25 0.50 0.75 1.00 . . . 10.00
回答1:
Shorter version without loop:
ComboBox1.List = [text(row(1:40)/4,"0.00")]
回答2:
maybe try getting rid of i from "Next i" i.e use only Next instead of Next 1
来源:https://stackoverflow.com/questions/45155642/vba-loop-to-fill-numbers-in-a-combobox