Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open Worksheet


How do you get a macro to run whenever a worksheet is opened

--
Darren
-----------------------------------------------------------------------
DarrenG's Profile: http://www.excelforum.com/member.php...fo&userid=3652
View this thread: http://www.excelforum.com/showthread.php?threadid=56506

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Open Worksheet

Darren,
Open the ThisWorkbook module and enter you code in the:
Private Sub Workbook_Open()

End Sub

NickHK

"DarrenG" wrote in
message ...

How do you get a macro to run whenever a worksheet is opened?


--
DarrenG
------------------------------------------------------------------------
DarrenG's Profile:

http://www.excelforum.com/member.php...o&userid=36529
View this thread: http://www.excelforum.com/showthread...hreadid=565060



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Open Worksheet

Hi Darren,

Try:

'=============
Private Sub Workbook_Open()
Call MyMacro
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman



"DarrenG" wrote in
message ...

How do you get a macro to run whenever a worksheet is opened?


--
DarrenG
------------------------------------------------------------------------
DarrenG's Profile:
http://www.excelforum.com/member.php...o&userid=36529
View this thread: http://www.excelforum.com/showthread...hreadid=565060



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Open Worksheet

Private Sub Worksheet_Activate()

'your code here


End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"DarrenG" wrote in
message ...

How do you get a macro to run whenever a worksheet is opened?


--
DarrenG
------------------------------------------------------------------------
DarrenG's Profile:

http://www.excelforum.com/member.php...o&userid=36529
View this thread: http://www.excelforum.com/showthread...hreadid=565060



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Open Worksheet

Hi Darren,

I misread your request.

If you mean worksheet, as stated, and not workbook, use the code suggested
by Bob.

---
Regards,
Norman




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open Worksheet


:) Perfect, thanks. :

--
Darren
-----------------------------------------------------------------------
DarrenG's Profile: http://www.excelforum.com/member.php...fo&userid=3652
View this thread: http://www.excelforum.com/showthread.php?threadid=56506

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
Excel 2007, Automatically open new worksheet on open. jkmyoung Excel Discussion (Misc queries) 4 March 29th 10 04:36 PM
My desktop worksheet shortcut will not open the Excel Worksheet Steve09 Excel Discussion (Misc queries) 2 September 17th 09 04:33 PM
How do I get a blank worksheet to open up when I open Excel? Art@ISCO Setting up and Configuration of Excel 0 July 17th 07 01:30 PM
'Save current worksheet'; 'Open next worksheet' - two command buttons englishmustard Excel Discussion (Misc queries) 1 April 7th 06 12:54 PM
How do I get my personal macro worksheet to open whenever I open . Claudia_R Excel Discussion (Misc queries) 3 December 9th 04 11:59 PM


All times are GMT +1. The time now is 05:25 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"