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


I have just started with Macros. I have recorded a few and want them to
run when you select a specific worksheet tab. The macros do
calculations and paste the data from another worksheet. When a user
selects the tab for the "Bottom5" worksheet, I want the macros to run.
How do I make this happen? Thanks for any help.


--
daddioja
------------------------------------------------------------------------
daddioja's Profile: http://www.excelforum.com/member.php...o&userid=35024
View this thread: http://www.excelforum.com/showthread...hreadid=547630

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Automatically run macros

If you right click on the required tab and select View Code, then put your
code into a specific sub routine such as:-

Private Sub Worksheet_Activate()
MsgBox "Hi"
End Sub

then each time you select that tab the code will execute.

"daddioja" wrote:


I have just started with Macros. I have recorded a few and want them to
run when you select a specific worksheet tab. The macros do
calculations and paste the data from another worksheet. When a user
selects the tab for the "Bottom5" worksheet, I want the macros to run.
How do I make this happen? Thanks for any help.


--
daddioja
------------------------------------------------------------------------
daddioja's Profile: http://www.excelforum.com/member.php...o&userid=35024
View this thread: http://www.excelforum.com/showthread...hreadid=547630


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Automatically run macros


Thanks a lot for the advice. It was perfect.

Does anyone know any sites that provide tips on basic syntax for
writing? I want to sort, copy, paste, etc. Thanks again for any help.


--
daddioja
------------------------------------------------------------------------
daddioja's Profile: http://www.excelforum.com/member.php...o&userid=35024
View this thread: http://www.excelforum.com/showthread...hreadid=547630

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 85
Default Automatically run macros

daddioja wrote:
I have just started with Macros. I have recorded a few and want them
to run when you select a specific worksheet tab. The macros do
calculations and paste the data from another worksheet. When a user
selects the tab for the "Bottom5" worksheet, I want the macros to run.
How do I make this happen? Thanks for any help.


Call them from the worksheet activate event:

Private Sub Worksheet_Activate()

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
Automatically run macros Shirley Excel Discussion (Misc queries) 1 August 7th 06 11:08 PM
Run macros automatically-AutoFit Cindy B Excel Discussion (Misc queries) 3 January 16th 06 07:54 PM
run macros automatically saunak Excel Discussion (Misc queries) 3 April 28th 05 12:58 PM
Automatically running macros Jonathan Vickers Excel Programming 1 February 24th 04 12:43 AM
Disable Macros Automatically ibeetb Excel Programming 1 December 11th 03 06:58 PM


All times are GMT +1. The time now is 04:58 PM.

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"