Ok, I think I've got it working like you want. At least to where you can view it.
I randomly changed some of the Due verbs, just so i could see if it was working.
You really should make a unique list from Column A on DE and NOT a list sheet. If someone is added, you'll have to remember to add them, whereas if you generate a unique list at runtime, the combobox will always have a current list of names.
Private Sub ComboBox1_Change()
'Worksheets("dettaglio USCITE").Select
'ListBox1.Value = Application.VLookup(Me.ComboBox1.Value, Range("a2:a40"), 1, 0)
Dim WS As Worksheet
Dim C As Range
Dim LastRow As Long
Dim A As Long
Me.ListBox1.Clear
Set WS = Worksheets("DE")
With WS
LastRow = .Cells(Rows.Count, "A").End(xlUp).Row
With .Range("a1:a" & LastRow)
Set C = .Find(Me.ComboBox1, LookIn:=xlValues)
If Not C Is Nothing Then
firstAddress = C.Address
Do
If C.Offset(0, Range("V1").Column - 1) = "Due" Then
With Me.ListBox1
'Column B - Invoice Number
.AddItem C.Offset(0, 1)
'Invoice Dae
.Column(1, .ListCount - 1) = C.Offset(0, 2)
'Value
.Column(2, .ListCount - 1) = C.Offset(0, 3)
'When due
.Column(3, .ListCount - 1) = C.Offset(0, 4)
'When Paid
If C.Offset(0, 5) = "" Then
.Column(4, .ListCount - 1) = "No Date"
Else
.Column(4, .ListCount - 1) = C.Offset(0, 5)
End If
'Payment method
.Column(5, .ListCount - 1) = C.Offset(0, 20)
'Status
.Column(6, .ListCount - 1) = C.Offset(0, 21)
'row number of the record
.Column(7, .ListCount - 1) = C.Row
End With
End If
Set C = .FindNext(C)
Loop While Not C Is Nothing And C.Address <> firstAddress
End If
End With
End With
End Sub
P.S. I had to turn off a lot of the References because it keep erroring out on me.
Bookmarks