Excel - OptionButton

 
Vista:
sin imagen de perfil

OptionButton

Publicado por Patricio (29 intervenciones) el 21/06/2007 23:21:57
Hola a todos, tengo un UserForm en el cual tengo 2 OptionButton y un CommandButon, yo deseo que al seleccionar una de las opciones y pulsar el CommandButton se abra la pagina que seleccione, estando en otro archivo...Tengo este codigo pero me da error, Alguien Puede AYUDARME PLISSSS

Private Sub CommandButton1_Click()

If OptionButton1.Value = True Then
opcion = "2006"
Else

If OptionButton2.Value = True Then
opcion = "2007"

Else

End If
End Sub
Private Sub OptionButton1_Click()
OptionButton1.Caption = "2006"
End Sub
Private Sub OptionButton2_Click()
OptionButton1.Caption = "2007"
End Sub

AGRADECERIA MILLONES LA AYUDA.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de Abraham Valencia
Val: 313
Ha mantenido su posición en Excel (en relación al último mes)
Gráfica de Excel

RE:OptionButton

Publicado por Abraham Valencia (2415 intervenciones) el 22/06/2007 00:09:46
Pues si ese es todo tu codigo, no veo ninguna instruccion que "abra" otros archivos. Si tienes "mas detalles" avisanos

Abraham
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:OptionButton

Publicado por Patricio Santana (29 intervenciones) el 22/06/2007 21:02:18
Private Sub CommandButton1_Click()

If OptionButton1.Value = True Then
opcion = "2006"
Workbooks.Open Filename:= _
"C:\Documents and Settings\psantana\Escritorio\Informes 2007\Informes Reponedores\2006.xls"
UserForm3.Hide
Else

If OptionButton2.Value = True Then
opcion = "2007"
Workbooks.Open Filename:= _
"C:\Documents and Settings\psantana\Escritorio\Informes 2007\Informes Reponedores\2007.xls"
UserForm3.Hide

Else

End If
End Sub

ESTO ES LO QUE TENGO DE CODIGO DENTRO DEL COMMANDBUTTON, LO QUE YO KIERO ES QUE AL SELECCIONAR UNA OPCION Y PRESIONAR EL BOTON ACEPTAR (CommandButton) ME ABRA EL ARCHIVO SELECCIONADO.

DENTRO DE LA CODIFICACION DE LOS OPTIONBUTTON DEBO COLOCAR OTRO CODIGO????????

DE ANTEMANO GRACIAS POR LA RESPUESTA.
Patricio
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar