Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Macro to run when sheet activated

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 72
Default Macro to run when sheet activated

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Password prompt when sheet is activated mmc308 Excel Programming 4 November 17th 06 07:25 AM
userform open when sheet activated ADK Excel Programming 11 September 7th 06 06:36 PM
Load VBA on Activated Sheet RigasMinho Excel Programming 2 July 25th 06 04:20 PM
Error sheet when macro's are not activated jgmiddel Excel Programming 0 March 22nd 06 09:28 PM
VBA - Left Shift to be Activated when Sheet is selected. BradWarr Excel Programming 1 June 22nd 04 01:25 PM


All times are GMT +1. The time now is 12:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"