且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何根据条件更改组合框中的字体颜色

更新时间:2022-04-28 02:57:14

你可以使用VBA来实现这一目标。在组合框的BeforeUpdate事件中,输入以下内容:

You can use VBA to accomplish this. In the BeforeUpdate event for the combobox, enter the following:

展开 | 选择 | Wrap | 行号


感谢您的快速回复。


当我尝试使用你的代码时,它并没有很好地工作。当我从我的组合框中选择时,它没有更改值,而是返回到组合框列表中的第一个值,例如,当我选择cust order 11111时,它在组合框上显示了cust order 00000因为00000是列表中的第一个托管订单。我错过了什么吗?
Thank you for the quick response.

When I tried to put your code, it didn''t work quite well. when I choose from my combo box, it didn''t change the value, instead it went back to the first value on the combo box list, for example, when I choose cust order 11111, it displayed cust order 00000 on the combo box since 00000 is the first cust order on the list. Am I missing something?


你能发布你的代码吗?