Va la macro
Private Sub Cbocliente_Change()
'Act.Por.Dante Amor
Dim Total As Integer
ListaPagos.Clear
TxtTotal.Text = ""
TxtDNIcliente = ""
If Cbocliente.ListIndex = -1 Or Cbocliente = "" Then
Exit Sub
End If
'
Set h = Sheets("deudas")
Set b = h.Range("B:B").Find(Cbocliente, lookat:=xlWhole)
If Not b Is Nothing Then
'dni = Cbocliente.List(Cbocliente.ListIndex, 1)
dni = b.Offset(0, -1)
TxtDNIcliente = dni
End If
'
If IsNumeric(dni) Then dni = Val(dni)
TxtDNIcliente = dni
Set h = Sheets("deudas")
Set r = h.Columns("A")
Set b = r.Find(dni, lookat:=xlWhole)
If Not b Is Nothing Then
ncell = b.Address
Do
'detalle
ListaPagos.AddItem h.Cells(b.Row, "C")
ListaPagos.List(ListaPagos.ListCount - 1, 1) = h.Cells(b.Row, "D")
ListaPagos.List(ListaPagos.ListCount - 1, 2) = h.Cells(b.Row, "E")
wtot = wtot + h.Cells(b.Row, "E")
Set b = r.FindNext(b)
Loop While Not b Is Nothing And b.Address <> ncell
End If
TxtTotal = wtot
End Sub