Hello there.
I have a userform with a combobox where I'd like to add background color to the lists items in the drop down menu. In the sheet I where the tems are picked from, I used conditional formatting to change the fill color of the different cells, and would like the code to pick this cell color. Alternatively using VBA to select colors of the items.
I have looked around and not found a good solution to this problem using vanilla Excel.
Here is the code so far.
Any help would be much appreciated.
Thanks!
I have a userform with a combobox where I'd like to add background color to the lists items in the drop down menu. In the sheet I where the tems are picked from, I used conditional formatting to change the fill color of the different cells, and would like the code to pick this cell color. Alternatively using VBA to select colors of the items.
I have looked around and not found a good solution to this problem using vanilla Excel.
Here is the code so far.
VBA Code:
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets("FACTtavle")
Dim I As Integer
Me.ComboBox1.Clear
Me.ComboBox1.AddItem ""
For I = 3 To sh.Range("B" & Application.Rows.Count).End(xlUp).Row
Me.ComboBox1.AddItem sh.Range("B" & I).Value 'and add cell color
Next I
End Sub
Any help would be much appreciated.
Thanks!