TextBox que muestre dato de celda y permita cambiarlo

Quería saber si podrías ayudarme con otro problemita. Tengo un formulario que tiene un comboBox que al llamar un dato de celda me muestra en textbox los datos de las celdas correspondientes a la primera. Pero necesito poder ingresar datos en estos textbox para que generen datos en las celdas pero que se sigan viendo en el formulario.

Respuesta
1

H o l a:

Con gusto te ayudo, podrías enviarme tu archivo con tu formulario.

Me explicas con un ejemplo lo que quieres realizar.

Sal u dos

H o l a:

Las macros:

Private Sub cbClienteTarjeta_Change()
'Por.Dante Amor
    If cbClienteTarjeta = "" Or cbClienteTarjeta.ListIndex = -1 Then Exit Sub
    f = cbClienteTarjeta.ListIndex + 2
    txtuno = Cells(f, "B")
    txtdos = Cells(f, "C")
    txttres = Cells(f, "D")
    txtcuatro = Cells(f, "E")
    txtcinco = Cells(f, "F")
    txtseis = Cells(f, "G")
    txtsiete = Cells(f, "H")
    txtocho = Cells(f, "I")
    txtnueve = Cells(f, "J")
    txtdiez = Cells(f, "K")
End Sub
Private Sub CommandButton1_Click()
'Por.Dante Amor
    If cbClienteTarjeta = "" Or cbClienteTarjeta.ListIndex = -1 Then Exit Sub
    f = cbClienteTarjeta.ListIndex + 2
    Cells(f, "B") = txtuno
    Cells(f, "C") = txtdos
    Cells(f, "D") = txttres
    Cells(f, "E") = txtcuatro
    Cells(f, "F") = txtcinco
    Cells(f, "G") = txtseis
    Cells(f, "H") = txtsiete
    Cells(f, "I") = txtocho
    Cells(f, "J") = txtnueve
    Cells(f, "K") = txtdiez
    MsgBox "Registro actualizado"
End Sub
Private Sub UserForm_Activate()
'Por.Dante Amor
    u = Range("A" & Rows.Count).End(xlUp).Row
    cbClienteTarjeta.RowSource = "TarjetaControl!A2:A" & u
End Sub

[code]':)
'Saludos. Dante Amor Recuerda valorar la respuesta.

Hola, agradezco mucho tu colaboración, el formulario realiza exactamente lo que quería, pero al incluirlo dentro del proyecto me muestra los datos de la hoja "Clientes" y no de la hoja "Control" que son los que debe leer, en que parte del rango debo colocar el nombre de la hoja para que me la seleccione?. Y mil gracias nuevamente.

Jorge

Macros actualizadas:

Private Sub cbClienteTarjeta_Change()
'Por.Dante Amor
    Set h = Sheets("TarjetaControl")
    If cbClienteTarjeta = "" Or cbClienteTarjeta.ListIndex = -1 Then Exit Sub
    f = cbClienteTarjeta.ListIndex + 2
    txtuno = h.Cells(f, "B")
    txtdos = h.Cells(f, "C")
    txttres = h.Cells(f, "D")
    txtcuatro = h.Cells(f, "E")
    txtcinco = h.Cells(f, "F")
    txtseis = h.Cells(f, "G")
    txtsiete = h.Cells(f, "H")
    txtocho = h.Cells(f, "I")
    txtnueve = h.Cells(f, "J")
    txtdiez = h.Cells(f, "K")
End Sub
'
Private Sub CommandButton1_Click()
'Por.Dante Amor
    Set h = Sheets("TarjetaControl")
    If cbClienteTarjeta = "" Or cbClienteTarjeta.ListIndex = -1 Then Exit Sub
    f = cbClienteTarjeta.ListIndex + 2
    h.Cells(f, "B") = txtuno
    h.Cells(f, "C") = txtdos
    h.Cells(f, "D") = txttres
    h.Cells(f, "E") = txtcuatro
    h.Cells(f, "F") = txtcinco
    h.Cells(f, "G") = txtseis
    h.Cells(f, "H") = txtsiete
    h.Cells(f, "I") = txtocho
    h.Cells(f, "J") = txtnueve
    h.Cells(f, "K") = txtdiez
    MsgBox "Registro actualizado"
End Sub
'
Private Sub UserForm_Activate()
'Por.Dante Amor
    Set h = Sheets("TarjetaControl")
    u = h.Range("A" & Rows.Count).End(xlUp).Row
    cbClienteTarjeta.RowSource = h.Name & "!A2:A" & u
End Sub

' : )
'S aludos. Dante Amor. R ecuerda valorar la respuesta. G racias
' : )

¡Gracias! Hola, Dante mil disculpas lo que sucede es que el archivo tiene por el momento 25 hojas activas es muy grandes y pues pensé en enviar solo el formulario y no caí en cuenta de eso. Pero mil y mil gracias. Super tus conocimientos.

Jorge

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas