Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim rpta As Integer
- Dim j1 As Integer
- Dim k1 As Integer
- Dim i1 As Integer
- Dim cadena As String
- j1 = ActiveCell.Offset(1, 0) 'fila 4
- k1 = ActiveCell.Offset(0, 1) 'columna D
- rpta = MsgBox("¿Desea registrar estos datos?", vbYesNo)
- If rpta = vbNo Then Exit Sub
- Range("A2").Select
- While ActiveCell <> ""
- ActiveCell.Offset(1, 0).Select
- If ActiveCell = Val(Txtn) Then
- rpta = MsgBox(" El postulante ya esta registrado, ¿Desea actualizar su informacion?", vbYesNo)
- If rpta = vbNo Then Exit Sub
- GoTo Sale
- End If
- Wend
- Sale:
- ActiveCell = Val(Txtn)
- ActiveCell.Offset(0, 1) = cboregimen
- ActiveCell.Offset(0, 2) = CDate(txtfecha)
- ActiveCell.Offset(0, 3) = cbounidad
- ActiveCell.Offset(0, 4) = UCase(txtcol)
- For i1 = 1 To Len(txtcol)
- If Mid(txtcol.Value, i1, 1) <> Chr(13) Then
- If Mid(txtcol.Value, i1, 1) <> Chr(10) Then
- cadena = cadena & Mid(txtcol.Value, i1, 1)
- End If
- Else
- Cells(j1, k1) = cadena
- j1 = j1 + 1 'para incrementar filas
- 'k = k + 1 'para incrementar columnas
- cadena = ""
- End If
- Next
- Cells(j1, k1) = cadena
- ActiveCell.Offset(0, 5) = txtdni
- ActiveCell.Offset(0, 6) = cbocargo
- ActiveCell.Offset(0, 7) = txtjornal
- ActiveCell.Offset(0, 8) = cbotact
- On Error Resume Next
- Application.ScreenUpdating = False
- End Sub
Add Comment
Please, Sign In to add comment