Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run a sheet's activate code when entering it's workbook


I have sheet activate code for every worksheet in a workbook.

I have auto_open code that selects the sheet named data.

The proplem is if the sheet named data was active when I exited the
workbook, the sheet active code for data will not execute when opening
the workbook. I have click another sheet then click back into the sheet
named data to get the code to execute.

Any ideas would be greatly appreciated. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490371

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Run a sheet's activate code when entering it's workbook

did you try the code on the thisworkbook code page
Private Sub Workbook_Open()
--


Gary


"mikeburg" wrote in
message ...

I have sheet activate code for every worksheet in a workbook.

I have auto_open code that selects the sheet named data.

The proplem is if the sheet named data was active when I exited the
workbook, the sheet active code for data will not execute when opening
the workbook. I have click another sheet then click back into the sheet
named data to get the code to execute.

Any ideas would be greatly appreciated. mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:
http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490371



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Run a sheet's activate code when entering it's workbook

Maybe just select a different sheet, then select the sheet you want in your
workbook_open event.

Or just call the worksheet_activate event from the workbook_open event:

Option Explicit
Private Sub Workbook_Open()
Call Sheet2.Worksheet_Activate
End Sub

Use the codename (I used sheet2).

And remove Private from the
Private Sub Worksheet_Activate()
line.

mikeburg wrote:

I have sheet activate code for every worksheet in a workbook.

I have auto_open code that selects the sheet named data.

The proplem is if the sheet named data was active when I exited the
workbook, the sheet active code for data will not execute when opening
the workbook. I have click another sheet then click back into the sheet
named data to get the code to execute.

Any ideas would be greatly appreciated. mikeburg

--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile: http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=490371


--

Dave Peterson
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
Run Code On Activate Theresa Excel Worksheet Functions 5 December 18th 07 05:47 AM
? activate a commandbutton in code ? tad_wegner[_6_] Excel Programming 1 October 10th 05 04:43 PM
Activate code in cell Steve Excel Programming 5 August 18th 05 07:44 PM
Help with code that finds a sheet's name KimberlyC Excel Programming 3 July 10th 05 10:08 PM
Why wouldn't calling the Activate sub for a sheet automatically call that sheet's Worksheet_Activate() sub? Scott Lyon Excel Programming 3 August 19th 03 03:03 PM


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

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

About Us

"It's about Microsoft Excel"