Tocogroup
asked on
Is it possible to highlight Excel VBA Listbox items in red according to certain criteria ?
Hi,
I have an Excel application with an Orders userform containing a listbox. I'd like to highlight the text of those Listbox items which haven't yet been invoiced (I use a status text box to determine this).
Any ideas ?
thanks
Toco
I have an Excel application with an Orders userform containing a listbox. I'd like to highlight the text of those Listbox items which haven't yet been invoiced (I use a status text box to determine this).
Any ideas ?
thanks
Toco
ASKER
Thanks for your help.
I load my listbox from an array in one single statement for speed and efficiency.....
liSales.List = SalesArray()
Is it possible to act on the listbox items directly, in some way or another? For example......
If liSales.Items(rowno,colno) .Value <> "Invoiced" Then
liSales.Items(row).ForeCol or = vbRed
End If
I tried the above but I couldn't get it to work
I load my listbox from an array in one single statement for speed and efficiency.....
liSales.List = SalesArray()
Is it possible to act on the listbox items directly, in some way or another? For example......
If liSales.Items(rowno,colno)
liSales.Items(row).ForeCol
End If
I tried the above but I couldn't get it to work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
No further response from members.
I found out elsewhere that Listbox controls cannot be formatted in the way I wish. However ListView controls (an Add-in) are formattable.
I found out elsewhere that Listbox controls cannot be formatted in the way I wish. However ListView controls (an Add-in) are formattable.
Dim c As Long
c = 1
For Each cll In Range("Table1").Columns(1)
ListBox1.AddItem cll.Value
If Cells(cll, 5).Value <> "" Then
ListBox1.items(c).ForeColo
End If
c = c + 1
Next cll