Is there a way to set the rows of a listbox to a different color just on a specific condition? For example, I build a list box where one column is the difference in charges for 2 months. If the difference is negative, I want to set that one row & column to red. I tried the below code, but no luck. Any suggestions?
Set ListBox = PctForm.LatestMonth
ListCount = ListBox.ListCount
For intI = 0 To ListCount - 1
If ListBox.Column(3, intI) < 0 Then
ListBox.ForeColor = vbRed
Else
ListBox.ForeColor = vbBlue
End If
Next
Set ListBox = PctForm.LatestMonth
ListCount = ListBox.ListCount
For intI = 0 To ListCount - 1
If ListBox.Column(3, intI) < 0 Then
ListBox.ForeColor = vbRed
Else
ListBox.ForeColor = vbBlue
End If
Next