VBA combobox style

百般思念 提交于 2019-12-12 01:02:30

问题


I have an Excel small interface. I changed a combobox style from fmStyleDropDownCombo to fmStyleDropDownList (I did this by - right click - Properties - Style). Now, I get an error:

"Could not set the Text property. Invalid property value"

on this line in VBA:

Worksheets("Sheet1").cmbSX.Text = Worksheets("Sheet2").Cells(9, 10)

This worked perfectly before I changed styles as described above (the change of style made the component uneditable manually). Any suggestion on how the code should be readjusted to this new style? Thank you!


回答1:


Change Text to Value

Worksheets("Sheet1").cmbSX.Value = Worksheets("Sheet2").Cells(9, 10)


来源:https://stackoverflow.com/questions/14742705/vba-combobox-style

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!