Ayuda con formularios

Soy novato con el VB y mis problemas son muchos. Tengo un formulario que capta información de la hoja activa pero además quisiera que me mostrara información de otras hojas y celdas del libro y ya puestos que este disponible para consultar esa información, desde cualquier hoja del libro. ¡Ayudadme! ¿Cómo puedo hacerlo?
Muchas gracias de antemano. Saludos a todos. Jesús

1 respuesta

Respuesta
1
Si tu formulario "capta" información de la hoja activa supongo que tendrás instrucciones como esta:
Textbox2.value = activesheet.range("AZ10").value
Para otras hojas será:
TextBox2.Value = Sheets("Consultas2004").Range("C10").value
Ahora lo que sigue.. "y ya puestos que este disponible para consultar esa información" no entiendo bien qué necesitas. Agradeceré lo expliques con un ejemplo.
Ante todo muchas gracias por tu disposición y rapidez.
Te explico lo que pretendo.
Tengo un libro destinado al control turnos y horas del personal. Estoy haciendo un formulario que busque información de varias hojas del mismo libro. Ya he logrado que busque la información en una hoja, pero ahora necesito que con la información que ya he seleccionado, busque información en otras hojas, para presentarla en este mismo formulario. Es decir, Selecciono a la persona por su nombre y mediante un botón de consulta aparecen los datos que necesito de ella, pues bien, ahora deseo que me muestre ciertos datos que tiene esa persona en otras hojas. Aunque estoy parado en la última parte (encontrar información en otra hoja) éste es el código de mi formulario hasta ahora.
Private Sub ComboBox1_Change()
TextBox2 = ComboBox1
End Sub
Private Sub CommandButton1_Click()
Range("b8").Select
Do While ActiveCell <> Empty
ActiveCell.Offset(1, 0).Select
ComboBox1.AddItem ActiveCell
Loop
ActiveCell.Offset(-1, 0).Select
Range("b8").Select
End Sub
Private Sub CommandButton2_Click()
Cells.Find(What:=TextBox2, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False).Activate
ActiveCell.Offset(0, -1).Select
TextBox1 = ActiveCell
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, 1).Select
TextBox3 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox4 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox5 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox6 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox7 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox8 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox9 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox10 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox11 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox12 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox13 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox14 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox15 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox16 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox17 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox18 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox19 = ActiveCell
ActiveCell.Offset(0, 1).Select
TextBox20 = ActiveCell
TextBox21 = Val(TextBox18) - Val(TextBox19) - Val(TextBox20)
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, 1).Select
TextBox22 = ActiveCell
Range("A9").Select
End Sub
Private Sub TextBox1_Change()
End Sub
Private Sub TextBox10_Change()
End Sub
Private Sub TextBox11_Change()
End Sub
Private Sub TextBox14_Change()
End Sub
Private Sub TextBox2_Change()
End Sub
Private Sub TextBox21_Change()
End Sub
Private Sub TextBox3_Change()
End Sub
Private Sub TextBox4_Change()
End Sub
Private Sub TextBox5_Change()
End Sub
Private Sub TextBox6_Change()
End Sub
Private Sub TextBox7_Change()
End Sub
Private Sub TextBox8_Change()
End Sub
Private Sub TextBox9_Change()
End Sub
Private Sub UserForm_Click()
End Sub
Aunque no he recibido respuesta a la 2ª parte, ya me he arreglado y te envío mil gracias por tu gran ayuda.
Un cordial saludo. Jesús

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas