Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Excel macro
 
Posts: n/a
Default Run macro automatically.

How do I make a macro run automatically when a worksheet it is attached to is
loaded?
  #2   Report Post  
Don Guillett
 
Posts: n/a
Default

right click on the sheet tabview codeleft window worksheetright window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in message
...
How do I make a macro run automatically when a worksheet it is attached to

is
loaded?



  #3   Report Post  
Sheela
 
Posts: n/a
Default

I am unable to find "activate " when I right click on worksheet. ( i assume
that you are referring to the windows explorer kind of interface which opens
up on the left of the visula basic window) . Sorry! I am new to excel and
many thanks for your quick response.

"Don Guillett" wrote:

right click on the sheet tabview codeleft window worksheetright window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in message
...
How do I make a macro run automatically when a worksheet it is attached to

is
loaded?




  #4   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi

See Chip Pearson's site for more info
http://www.cpearson.com/excel/events.htm

Example code :

Sub Auto_open()
MsgBox "Hi"
End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro

Or a event

Private Sub Workbook_Open()
'macro name or code
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save and close the file



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" wrote in message ...
I am unable to find "activate " when I right click on worksheet. ( i assume
that you are referring to the windows explorer kind of interface which opens
up on the left of the visula basic window) . Sorry! I am new to excel and
many thanks for your quick response.

"Don Guillett" wrote:

right click on the sheet tabview codeleft window worksheetright window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in message
...
How do I make a macro run automatically when a worksheet it is attached to

is
loaded?






  #6   Report Post  
Sheela
 
Posts: n/a
Default

Thanks a bunch...It works. Also how do I make the macro run automatically
whenever the value in a cell changes?

"Ron de Bruin" wrote:

Hi

See Chip Pearson's site for more info
http://www.cpearson.com/excel/events.htm

Example code :

Sub Auto_open()
MsgBox "Hi"
End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro

Or a event

Private Sub Workbook_Open()
'macro name or code
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save and close the file



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" wrote in message ...
I am unable to find "activate " when I right click on worksheet. ( i assume
that you are referring to the windows explorer kind of interface which opens
up on the left of the visula basic window) . Sorry! I am new to excel and
many thanks for your quick response.

"Don Guillett" wrote:

right click on the sheet tabview codeleft window worksheetright window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in message
...
How do I make a macro run automatically when a worksheet it is attached to
is
loaded?






  #7   Report Post  
Don Guillett
 
Posts: n/a
Default

use a worksheet_CHANGE event

--
Don Guillett
SalesAid Software

"Sheela" wrote in message
...
Thanks a bunch...It works. Also how do I make the macro run automatically
whenever the value in a cell changes?

"Ron de Bruin" wrote:

Hi

See Chip Pearson's site for more info
http://www.cpearson.com/excel/events.htm

Example code :

Sub Auto_open()
MsgBox "Hi"
End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file

with a macro

Or a event

Private Sub Workbook_Open()
'macro name or code
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save and close the file



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" wrote in message

...
I am unable to find "activate " when I right click on worksheet. ( i

assume
that you are referring to the windows explorer kind of interface

which opens
up on the left of the visula basic window) . Sorry! I am new to excel

and
many thanks for your quick response.

"Don Guillett" wrote:

right click on the sheet tabview codeleft window worksheetright

window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in

message
...
How do I make a macro run automatically when a worksheet it is

attached to
is
loaded?








  #8   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Hi sheela

See Chip's site
look for the change event

On this page you can see how you can use it
http://www.rondebruin.nl/mail/change.htm

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" wrote in message ...
Thanks a bunch...It works. Also how do I make the macro run automatically
whenever the value in a cell changes?

"Ron de Bruin" wrote:

Hi

See Chip Pearson's site for more info
http://www.cpearson.com/excel/events.htm

Example code :

Sub Auto_open()
MsgBox "Hi"
End Sub

Must be in a normal module
If you use a Auto_open macro then this wil not run if you open the file with a macro

Or a event

Private Sub Workbook_Open()
'macro name or code
End Sub

Right click on the Excel icon next to File in the menubar
And choose View code

You are now in the Thisworkbook module
Paste the Event in this place
Alt-Q to go back to Excel
Save and close the file



--
Regards Ron de Bruin
http://www.rondebruin.nl



"Sheela" wrote in message ...
I am unable to find "activate " when I right click on worksheet. ( i assume
that you are referring to the windows explorer kind of interface which opens
up on the left of the visula basic window) . Sorry! I am new to excel and
many thanks for your quick response.

"Don Guillett" wrote:

right click on the sheet tabview codeleft window worksheetright window
activate

--
Don Guillett
SalesAid Software

"Excel macro" <Excel
wrote in message
...
How do I make a macro run automatically when a worksheet it is attached to
is
loaded?








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
Execute Macro automatically after hyperlink Bill Elerding Excel Discussion (Misc queries) 13 May 5th 05 01:01 AM
Automatically run Macro tamato43 Excel Discussion (Misc queries) 0 March 30th 05 03:51 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
How can I set up a Macro to automatically run when I open a speci. Rick Martin Excel Discussion (Misc queries) 1 January 13th 05 05:06 PM
Automatically launch a macro when a fil is opened One-Leg Excel Discussion (Misc queries) 1 December 15th 04 08:12 PM


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