Listbox Change Row Colors

Jaye7

Well-known Member
Joined
Jul 7, 2010
Messages
1,060
In A listbox, can you change the colors of each row in the listbox itself, i.e. row one in the listbox is white, row two is yellow or does it have to be one specific color. Thanks :confused::confused::confused:
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Not easy.

A shaky workaound written by myself HERE.

Not exactly a multicolored listbox but very nice and more stable workaround by Andypope HERE.

You can also use the ListView OCX and set the Icons/SmallIcons Properties to some color images..
 
Upvote 0
Thanks Mike And Jaafar.

I went with the Andy pope example, sorry I should have mentioned that the listbox was in a userform.

Not exactly what I am after but makes the listbox look a bit more classy.

Thanks guys.

If anyone else has a method please advise.
 
Upvote 0
Hello All,
I would like to ask in regards my below code that is there any way to show the certain text in color only such as if I request to show all the text named APPLE will be red as a text when the list pop up...
is it possible?
Many Thanks


VBA Code:
Dim a, i As Long, ii As Long, b(), n As Long
ListBox1.Clear
With ComboBox1
If .Text = "" Then Exit Sub
If WorksheetFunction.CountIf(Worksheets("list").Range("a:a"), .Text) = 0 Then
Exit Sub
End If
n = -1
a = Worksheets("list").Range("a1").Resize(Worksheets("list").Range("a" & Rows.Count).End(xlUp).Row, 35).Value
For i = 1 To UBound(a, 1)
If a(i, 1) = .Text Then
n = n + 2: ReDim Preserve b(1 To 35, 1 To n)
For ii = 1 To UBound(a, 2)
b(ii, n) = a(i, ii)
Next
End If
Next
End With
With ListBox1
.ColumnCount = 35
.ColumnWidths = "0;0;150;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;42;0"
.Column = b
End With
 
Upvote 0

Forum statistics

Threads
1,215,759
Messages
6,126,727
Members
449,332
Latest member
nokoloina

We've detected that you are using an adblocker.

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.
Go back
Back
Top