ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro autorunning (https://www.excelbanter.com/excel-programming/306359-macro-autorunning.html)

pjotr

Macro autorunning
 
Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka

Don Guillett[_4_]

Macro autorunning
 
Right click on the worksheet tabview codeleft window select
worksheetright window select activate.

--
Don Guillett
SalesAid Software

"pjotr" wrote in message
...
Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka




pjotr

Macro autorunning
 
Thanks Don but still I have the same problem. The Macro (sub test()) do not
run automatically when selecting sheet2 unless I put put the macro in the
sheet2 VBA-area. What did I do wrong?
Pjotr

"Don Guillett" kirjoitti:

Right click on the worksheet tabview codeleft window select
worksheetright window select activate.

--
Don Guillett
SalesAid Software

"pjotr" wrote in message
...
Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka





Gord Dibben

Macro autorunning
 
Pekka

Right-click on the sheet tab and "view code"

Copy/paste this into the module.

Private Sub Worksheet_Activate()
your_macro_name
End Sub

Gord Dibben Excel MVP

On Sun, 8 Aug 2004 10:33:02 -0700, "pjotr"
wrote:

Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka



Don Guillett[_4_]

Macro autorunning
 
That's where to put it to have it run when you activate THAT sheet.

--
Don Guillett
SalesAid Software

"pjotr" wrote in message
...
Thanks Don but still I have the same problem. The Macro (sub test()) do

not
run automatically when selecting sheet2 unless I put put the macro in the
sheet2 VBA-area. What did I do wrong?
Pjotr

"Don Guillett" kirjoitti:

Right click on the worksheet tabview codeleft window select
worksheetright window select activate.

--
Don Guillett
SalesAid Software

"pjotr" wrote in message
...
Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka







pjotr

Macro autorunning
 
Thanks Gord. now it works

"Gord Dibben" kirjoitti:

Pekka

Right-click on the sheet tab and "view code"

Copy/paste this into the module.

Private Sub Worksheet_Activate()
your_macro_name
End Sub

Gord Dibben Excel MVP

On Sun, 8 Aug 2004 10:33:02 -0700, "pjotr"
wrote:

Hi
How can I get a certain macro run automaticly when selectin a certain
worksheet?
(excel 2003)
rgds, Pekka





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com