Como hago par que el foco se me situe en el textBox luego que me muestre que el código ingresado no aparece registrado. lo tengo así:
Private Sub TextBox2_AfterUpdate()
Set h1 = Sheets("Hoja1")
Set h2 = Sheets("Hoja2")
Set r = h1.Columns("A")
dato = TextBox2
Set b = r.Find(dato, lookat:=xlWhole)
If Not b Is Nothing Then
' u = h2.Range("A" & Rows.Count).End(xlUp).Row + 1
TextBox3 = h1.Cells(b.Row, "B")
'
' h2.Cells(u, "A") = TextBox2 ' valor de peso
' h2.Cells(u, "B") = h1.Cells(b.Row, "B")
'h2.Cells(u, "C") = h1.Cells(b.Row, "C")
' h2.Cells(u, "D") = TextBox2 ' valor de peso
Else
MsgBox "No existe el Código"
Cancel = True
TextBox2 = ""
Me.TextBox2.SetFocus
End If
End Sub
Lo que quiero es que me de la portunidad de digitar otro código y no que me salte al textbox siguiente.
¿Me podrías ayudar? por fa. !