Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Need help with Excel VB

Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 145
Default Need help with Excel VB

There is a workbook open event in which any code can be triggered when the
workbook is opened.

Right click on the Excel icon next to the File menu - View code - Select
Workbook in the drop down menu containing General.

--

Damon Longworth

2007 East Coast Excel / Access User Conference
April 18-20, 2007 - Providing Microsoft Excel training and Microsoft Excel
Classes
Atlantic City, New Jersey
www.ExcelUserConference.com/ECEUC.html

wrote in message
oups.com...
Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Need help with Excel VB

Yes there is and it is called an event.
Right-click the sheet, select view code and insert something like:

Private Sub Worksheet_Activate()
MsgBox ("Hello world")
End Sub

Per Erik

wrote:
Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help with Excel VB

Just some supplementary information:
A useful overview of events is available at Chip Pearon's site:

http://www.cpearson.com/excel/events.htm
and application level events
http://www.cpearson.com/excel/appevent.htm

--
Regards,
Tom Ogilvy

"Damon Longworth" wrote in message
...
There is a workbook open event in which any code can be triggered when the
workbook is opened.

Right click on the Excel icon next to the File menu - View code - Select
Workbook in the drop down menu containing General.

--

Damon Longworth

2007 East Coast Excel / Access User Conference
April 18-20, 2007 - Providing Microsoft Excel training and Microsoft
Excel
Classes
Atlantic City, New Jersey
www.ExcelUserConference.com/ECEUC.html

wrote in message
oups.com...
Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Need help with Excel VB

Private Sub Worksheet_Activate()
'do your stuff
End Sub


Gord Dibben MS Excel MVP

On 17 Feb 2007 11:41:19 -0800, wrote:

Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Need help with Excel VB

On Feb 17, 2:15 pm, "Tom Ogilvy" wrote:
Just some supplementary information:
A useful overview of events is available at Chip Pearon's site:

http://www.cpearson.com/excel/events.htm
and application level eventshttp://www.cpearson.com/excel/appevent.htm

--
Regards,
Tom Ogilvy

"Damon Longworth" wrote in message

...



There is a workbook open event in which any code can be triggered when the
workbook is opened.


Right click on the Excel icon next to the File menu - View code - Select
Workbook in the drop down menu containing General.


--


Damon Longworth


2007 East Coast Excel / Access User Conference
April 18-20, 2007 - Providing Microsoft Excel training and Microsoft
Excel
Classes
Atlantic City, New Jersey
www.ExcelUserConference.com/ECEUC.html


wrote in message
roups.com...
Hi, is there some macro command in Excel VB with is triggered when a
given worksheet is opened? If so what's the syntax? Many thanks in
advance.- Hide quoted text -


- Show quoted text -


Many thanks to you and everyone else who replied. Very useful stuff.

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



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