Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Call an Excel Macro when a Sheet is selected

Right click on the Sheet Tab. Select 'View Code'. Place this in the
module.

Private Sub Worksheet_Activate()
Call MyExcelMacro
End Sub

Each time that the worksheet is activated, your MyExcelMacro will run.

Here are some links that have good info on events. You are using the
Worksheet_Activate Event.

http://www.mvps.org/dmcritchie/excel/event.htm
http://www.cpearson.com/excel/events.htm

http://support.microsoft.com/default...20&Product=xlw
http://support.microsoft.com/default...b;EN-US;291294
http://support.microsoft.com/default...b;EN-US;161761

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------
Hi,

I was wondering if someone could help me with some simple code to Call
an Excel Macro I have when a Sheet (tab) is first selected.

Thanks, Grant

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
Write macro to lock selected sheet when run office3000 Excel Discussion (Misc queries) 1 October 14th 08 06:49 PM
Call an Access macro from an Excel macro Jason W Excel Discussion (Misc queries) 1 May 1st 08 08:33 PM
Referring to the previous selected sheet in a macro michaelberrier Excel Discussion (Misc queries) 2 June 12th 06 01:35 PM
macro to extract data of a selected sheet TUNGANA KURMA RAJU Excel Discussion (Misc queries) 1 February 27th 06 06:47 AM
Can I use a variable to call up another sheet in Excel? GD Cooley Excel Worksheet Functions 1 February 13th 05 05:40 AM


All times are GMT +1. The time now is 01:36 PM.

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"