H o l a:
Te anexo la macro para cargar la factura con todos los productos.
Private Sub Worksheet_Change(ByVal Target As Range)
'Por.Dante Amor
If Target.Count > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Target.Address <> "$C$11" Then Exit Sub
'
Set h = Sheets("Ventas")
Set r = h.Columns("D")
Set b = r.Find(Target.Value, lookat:=xlWhole)
'
Application.ScreenUpdating = False
u = 0
i = 17
For j = Range("B" & Rows.Count).End(xlUp).Row To i Step -1
If Cells(j, "B") = "Forma de Pago" Then
u = j - 1
Exit For
End If
Next
If u = 0 Then u = 37
Range("B" & i & ":E" & u).ClearContents
Range("C12:C15, H11:H12") = "" 'limpia datos
'
If Not b Is Nothing Then
celda = b.Address
'
Range("C12") = h.Cells(b.Row, "E") 'cliente
'Range("C13") = h.Cells(b.Row, "B") 'dir
'Range("C14") = h.Cells(b.Row, "B") 'nit
'Range("C15") = h.Cells(b.Row, "B") 'tel
'Range("H11") = h.Cells(b.Row, "B") 'fec
Range("H12") = h.Cells(b.Row, "K") 'descuento
Do
'detalle
If i >= u Then
Rows(i).Insert
End If
Cells(i, "B") = h.Cells(b.Row, "A") 'cod
Cells(i, "C") = h.Cells(b.Row, "F") 'prod
Cells(i, "D") = h.Cells(b.Row, "H") 'cant
Cells(i, "E") = h.Cells(b.Row, "I") 'precio
i = i + 1
Set b = r.FindNext(b)
Loop While Not b Is Nothing And b.Address <> celda
End If
End Sub
' : )
'S aludos. Dante Amor. Recuerda valorar la respuesta. G racias
' : )