i want to populate information from range("A3:H40") to listbox only if Cell in Column("H") is colored red. the provided code list them all, even when a cell in column h is not red.
VBA Code:
Dim lbtarget As MSForms.ListBox
Dim rngSource As Range
Set rngSource = Sheet1.Range("A3:H19")
Dim RNG As Range
Set RNG = Sheet1.Range("H3:H19")
Dim Cell As Range
Set lbtarget = Me.ListBox1
With lbtarget
.ColumnCount = 8
.ColumnWidths = "100;100;100;100;100;100;60;60"
For Each Cell In RNG
If Cell.Interior.ColorIndex = 3 Then
.List = rngSource.Cells.value
End If
Next
End With