Does anyone know how to change a listboxes' text color in code? I am trying to change the color of the listbox based on a condition.
For example
Sub OptionButton1.Change()
Y = Worksheets("Sheet1").Range("A1")
If Y = "Yes" Then
Listbox1.Clear
Listbox1.additem "Yes"
Else
Listbox1.Clear
Listbox1.additem "No"
End If
End Sub
I would like the listbox to show the "Yes" and "No" in different colors. Is there a format function to change this [i.e. additem format("Yes",?)]?
Thanks for the help.
For example
Sub OptionButton1.Change()
Y = Worksheets("Sheet1").Range("A1")
If Y = "Yes" Then
Listbox1.Clear
Listbox1.additem "Yes"
Else
Listbox1.Clear
Listbox1.additem "No"
End If
End Sub
I would like the listbox to show the "Yes" and "No" in different colors. Is there a format function to change this [i.e. additem format("Yes",?)]?
Thanks for the help.