VBA组合框样式 [英] VBA combobox style

查看:98
本文介绍了VBA组合框样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Excel小型界面.我将组合框样式从 fmStyleDropDownCombo 更改为 fmStyleDropDownList (我通过-右键单击-属性-样式来做到这一点). 现在,我得到一个错误:

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:

无法设置Text属性.无效的属性值"

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

在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!

推荐答案

Text更改为Value

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

这篇关于VBA组合框样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆