H o l a:
Este es el código para buscar el código y ponerte en los textbox2 y 3 los datos de las columnas 4 y 5
Private Sub CommandButton1_Click()
'Por.Dante Amor
If TextBox1 = "" Then
MsgBox "Captura el código del cliente", vbExclamation, "ERROR"
TextBox1.SetFocus
Exit Sub
End If
'
Set h = Sheets("Hoja1")
Set b = h.Columns("A").Find(TextBox1, lookat:=xlWhole)
If Not b Is Nothing Then
TextBox2 = h.Cells(b.Row, "D")
TextBox3 = h.Cells(b.Row, "E")
Else
MsgBox "El código del cliente no existe", vbExclamation, "ERROR"
TextBox1.SetFocus
End If
End Sub
Después de que actualices los datos, debes presionar otro botón para actualizar.
Pon el siguiente código en el formulario para el botón 2
Private Sub CommandButton2_Click()
'Por.Dante Amor
If TextBox1 = "" Then
MsgBox "Captura el código del cliente", vbExclamation, "ERROR"
TextBox1.SetFocus
Exit Sub
End If
'
Set h = Sheets("Hoja1")
Set b = h.Columns("A").Find(TextBox1, lookat:=xlWhole)
If Not b Is Nothing Then
h.Cells(b.Row, "D") = TextBox2
h.Cells(b.Row, "E") = TextBox3
MsgBox "Datos actualizados", vbInformation, "CAMBIAR"
TextBox1.SetFocus
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
Else
MsgBox "El código del cliente no existe", vbExclamation, "ERROR"
TextBox1.SetFocus
End If
End Sub