Hola buenos días amigo, gracias por su respuesta. Aun persiste el detalle.
Este es el código que tengo:
Código en la búsqueda:
Private Sub cmdbuscar_Click()
On Error Resume Next
If Me.TXT1.Value = Empty Then
MsgBox "Escriba dato para buscar"
Me.ListBox1.Clear
Me.TXT1.SetFocus
Exit Sub
End If
Me.ListBox1.Clear
items = Range("Nombres").CurrentRegion.Rows.Count
For i = 2 To items
If LCase(Cells(i, 1).Value) Like "*" & LCase(Me.TXT1.Value) & "*" Then
Me.ListBox1.AddItem Cells(i, 1)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Cells(i, 2)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Cells(i, 3)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Cells(i, 4)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Cells(i, 5)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = Cells(i, 6)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = Cells(i, 7)
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 7) = Cells(i, 8)
End If
Next i
Me.TXT1.SetFocus
Me.TXT1.SelStart = 0
Me.TXT1.SelLength = Len(Me.TXT1.Text)
Exit Sub
End Sub
codigo en Listbox1:
Private Sub ListBox1_Click()
On Error Resume Next
TextBox1.Text = ListBox1.List(ListBox1.ListIndex, 0)
TextBox5.Text = ListBox1.List(ListBox1.ListIndex, 1)
TextBox6.Text = ListBox1.List(ListBox1.ListIndex, 2)
TextBox7.Text = ListBox1.List(ListBox1.ListIndex, 3)
TextBox16.Text = ListBox1.List(ListBox1.ListIndex, 4)
Select Case ListBox1.List(ListBox1.ListIndex, 5)
Case "001"
TextBox8.Text = "OAXACA"
Case "002"
TextBox8.Text = "PUTLA"
Case "006"
TextBox8.Text = "MIAHUATLAN"
End Select
TextBox9.Text = ListBox1.List(ListBox1.ListIndex, 6)
TextBox10.Text = ListBox1.List(ListBox1.ListIndex, 7)
End Sub
codigo del Textbox16 (importe)
Private Sub TextBox16_Change()
On Error Resume Next
'TextBox16 = Format(TextBox16, "#,###.00")
'TextBox16.Value = FormatNumber(TextBox16.Value, 2)
ListBox1.List(ListBox1.ListCount - 1, 4) = FormatNumber(TextBox16, 2)
End Sub