Jump to content
Sign in to follow this  
Milton Cordova

Ayuda macro mostrar ocultar hojas

Recommended Posts

Saludos necesito una macro que al seleccionar la celda A1 en la Hoja 2 se muestra la Hoja "casa" en la celda a1, y al momento de salir de la hoja "casa" esta se oculte

lo he intentado asi pero no funciona

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address(False, False) = "A1" Then

Sheets("casa").Visible = True

Sheets("casa").Select

End If

End Sub

Private Sub Worksheet_Deactivate()

Sheets("casa").Select

Sheets("casa").Visible = False

End Sub

control.xls

Share this post


Link to post
Share on other sites
Guest FernandoML

Hola Milton:

Cambia tu código por este otro y nos comentas


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$A$1" Then
Sheets("casa").Visible = True
Else
Sheets("casa").Visible = False
End If
End Sub
[/CODE]

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  



×
×
  • Create New...

Important Information

Privacy Policy


CTA Templates.png