Ver Mensaje Individual
  #1 (permalink)  
Antiguo 30/11/2009, 09:49
patricia:)
 
Fecha de Ingreso: abril-2006
Ubicación: Venezuela
Mensajes: 126
Antigüedad: 18 años
Puntos: 0
Buscar y modificar en un form en excel

Hola a todos, realize un form en excel que inserta datos en una hoja. Tiene varios controles como textbox, optionbutton y combobox, quiero colocar una casilla de texto que al buscar por el "nombre de un usuario" me cargue los datos en todos los controles anteriormente mencionados y pueda modificar ese registro.

Alguien puede ayudarme, les agradecere de antemanos cualquier ayuda brindada.

Les adjunto la imagen de la aplicacion:





Les anexo el codigo de la aplicacion:


Private Sub ComboBox1_Change()
Worksheets("Requerimientos").Range("D9").Select
ActiveCell.FormulaR1C1 = ComboBox1
End Sub

Private Sub Insertar_Click()
Selection.EntireRow.Insert
TextBox1 = Empty
TextBox4 = Empty
TextBox3 = Empty
TextBox5 = Empty
TextBox6 = Empty
TextBox7 = Empty
TextBox8 = Empty
TextBox9 = Empty
TextBox10 = Empty
OptionButton1 = Empty
OptionButton2 = Empty
OptionButton3 = Empty
OptionButton4 = Empty
TextBox1.SetFocus
End Sub


// al hacer clic en salir cierra el Form y muestra la hoja de excel.
'Private Sub Salir_Click()
'Unload UserForm1
'Application.Visible = True
'ThisWorkbook.Activate
'End
'End Sub


Private Sub OptionButton1_Click()
Worksheets("Requerimientos").Range("B9").Select
ActiveCell.FormulaR1C1 = "Vía Telefónica"
End Sub

Private Sub OptionButton2_Click()
Worksheets("Requerimientos").Range("B9").Select
ActiveCell.FormulaR1C1 = "Vía Correo Electrónico"
End Sub


Private Sub OptionButton3_Click()
If OptionButton3.Value = True Then
Worksheets("Requerimientos").Range("L9").Select
ActiveCell.FormulaR1C1 = "X"
Worksheets("Requerimientos").Range("K9").Select
ActiveCell.FormulaR1C1 = " "
End If
End Sub


Private Sub OptionButton4_Click()
If OptionButton4.Value = True Then
Worksheets("Requerimientos").Range("K9").Select
ActiveCell.FormulaR1C1 = "X"
Worksheets("Requerimientos").Range("L9").Select
ActiveCell.FormulaR1C1 = " "
End If
End Sub


Private Sub TextBox1_Change()
largo_entrada = Len(Me.TextBox1)
Select Case largo_entrada
Case 3
Me.TextBox1.Value = Me.TextBox1.Value & "."
Case 8
Me.TextBox1.Value = Me.TextBox1.Value & "."

Case 11
Me.TextBox1.Value = Me.TextBox1.Value & "."
End Select
Worksheets("Requerimientos").Range("A9").Select
ActiveCell.FormulaR1C1 = TextBox1
End Sub


Private Sub TextBox10_Change()
largo_entrada = Len(Me.TextBox10)
Select Case largo_entrada
Case 2
Me.TextBox10.Value = Me.TextBox10.Value & ":"
End Select
Worksheets("Requerimientos").Range("I9").Select
ActiveCell.FormulaR1C1 = Format(TextBox10, "hh:mm")
End Sub


Private Sub TextBox3_Change()
largo_entrada = Len(Me.TextBox3)
Select Case largo_entrada
Case 2
Me.TextBox3.Value = Me.TextBox3.Value & "/"
Case 5
Me.TextBox3.Value = Me.TextBox3.Value & "/"
End Select
Worksheets("Requerimientos").Range("F9").Select
ActiveCell.FormulaR1C1 = Format(TextBox3, "dd/mmm/yyyy")
End Sub


Private Sub TextBox4_Change()
Worksheets("Requerimientos").Range("M9").Select
ActiveCell.FormulaR1C1 = TextBox4
End Sub


Private Sub TextBox5_Change()
Worksheets("Requerimientos").Range("C9").Select
ActiveCell.FormulaR1C1 = TextBox5
End Sub


Private Sub TextBox6_Change()
largo_entrada = Len(Me.TextBox6)
Select Case largo_entrada
Case 2
Me.TextBox6.Value = Me.TextBox6.Value & ":"
'Case 5
'Me.TextBox6.Value = Me.TextBox6.Value & ":"
End Select
Worksheets("Requerimientos").Range("G9").Select
ActiveCell.FormulaR1C1 = Format(TextBox6, "hh:mm")
End Sub


Private Sub TextBox7_Change()
Worksheets("Requerimientos").Range("E9").Select
ActiveCell.FormulaR1C1 = TextBox7
End Sub


Private Sub TextBox8_Change()
Worksheets("Requerimientos").Range("J9").Select
ActiveCell.FormulaR1C1 = TextBox8
End Sub


Private Sub CmdExit_Click()
salir
End Sub


Private Sub TextBox9_Change()
largo_entrada = Len(Me.TextBox9)
Select Case largo_entrada
Case 2
Me.TextBox9.Value = Me.TextBox9.Value & "/"
Case 5
Me.TextBox9.Value = Me.TextBox9.Value & "/"
End Select
Worksheets("Requerimientos").Range("H9").Select
ActiveCell.FormulaR1C1 = Format(TextBox9, "dd/mmm/yyyy")
End Sub


Private Sub ControlRequerimiento_Initialize()
miHoja = ""
OptionButton3.Value = False
OptionButton4.Value = False
End Sub