[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Re: Macro to run when sheet activated

Dave Miller

12/13/2006 8:48:00 PM

Place this code in the 'ThisWorkbook' section of the VBE:

David Miller


====================================================

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Trigger" Then
Sheets("A").Visible = True
Sheets("A").Visible = True
Sheets("A").Visible = True
End If
End Sub

1 Answer

Dave Miller

12/13/2006 9:27:00 PM

0

Try this:

David Miller

==================================================================

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "Trigger" Then
If Sheets("A").vibible = True And Sheets("B").Visible = True And
Sheets("C").Visible = True Then
Sheets("A").Visible = True
Sheets("B").Visible = True
Sheets("C").Visible = True
Else
Sheets("A").Visible = True
Sheets("B").Visible = True
Sheets("C").Visible = True
End If
End Sub