Ayuda con la macro algo le falta...
Hola buen día a todos mi pregunta es la siguiente: tengo un formulario creado por vb de excel lo que se supone que hace es ingresar registros a la hoja en curso y en caso de que el dato ya exista, emitir el mensaje de su existencia, mi problema es que al momento de validar la existencia si yo escribo en el textbox1 = jose martinez me deja ingresar el registro siendo que no debería por que ya existe pero como Jose Martinez, ojala me puedan ayudar a ver que me esta fallando ya que quiero que me avise si esta repetido incluso si cambia el formato de las letras en minúsculas o mayúsculas.
Dim R As Range
Usuario_repetido = textbox1.Text
Set R = [a:a].Find(What:=Usuario_repetido)
If txb1 = R Then
MsgBox "Nombre ya registrado!!" & UCase(txb1) & ".", vbExclamation
Else
Dim intRespuesta As Integer
intRespuesta = MsgBox("¿Es correcta la información?", vbQuestion + vbYesNo, "Información importante")
If intRespuesta = 6 Then
Rows("5:5").Select
Selection.insert Shift:=xlDown
ActiveCell = textbox1
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox2
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox3
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox4
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox5
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox6
Range("A1:F65").Sort Key1:=Range("F2"), Order1:=xlAscending, Key2:=Range( _
"A2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
MsgBox "Listo", vbInformation
textbox1 = Empty
textbox2 = Empty
textbox3 = Empty
textbox4 = Empty
textbox5 = Empty
textbox6 = Empty
Else
textbox1 = Empty
textbox2 = Empty
textbox3 = Empty
textbox4 = Empty
textbox5 = Empty
textbox6 = Empty
End If
Dim R As Range
Usuario_repetido = textbox1.Text
Set R = [a:a].Find(What:=Usuario_repetido)
If txb1 = R Then
MsgBox "Nombre ya registrado!!" & UCase(txb1) & ".", vbExclamation
Else
Dim intRespuesta As Integer
intRespuesta = MsgBox("¿Es correcta la información?", vbQuestion + vbYesNo, "Información importante")
If intRespuesta = 6 Then
Rows("5:5").Select
Selection.insert Shift:=xlDown
ActiveCell = textbox1
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox2
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox3
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox4
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox5
ActiveCell.Offset(0, 1).Select
ActiveCell = textbox6
Range("A1:F65").Sort Key1:=Range("F2"), Order1:=xlAscending, Key2:=Range( _
"A2"), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase _
:=False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, _
DataOption2:=xlSortNormal
MsgBox "Listo", vbInformation
textbox1 = Empty
textbox2 = Empty
textbox3 = Empty
textbox4 = Empty
textbox5 = Empty
textbox6 = Empty
Else
textbox1 = Empty
textbox2 = Empty
textbox3 = Empty
textbox4 = Empty
textbox5 = Empty
textbox6 = Empty
End If
1 Respuesta
Respuesta de calvuch
1