Need code for changing the backcolor of a listbox (on the surface of excel), through VBA (excel 2003). The color is "&H0050D092&" ....."yes" need to use this color.
There are 2 types of ListBox controls: Forms and ActiveX (Control Tollbox). With the Forms control you can not change the back color. With the ActiveX control you can by setting the BackColor property.
EDIT: You can replace "ActiveSheet" with the worksheet that ListBox is on like, "Worksheets("Sheet1").OLEObjects("ListBox1").Object.BackColor = &H50D092
This helped....Have another related question.......
I have two lisbox. If user select a certain value in listbox1, then listbox2 gets turned to a certain color. I have this down. But when the backcolor for listbox2 is changed, the selected value in listbox2 is lost. Is it possible to keep it?
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.