Automatic Execution of Macros

Joined
Oct 19, 2002
Messages
2
I am doing an assignment and need to have a macro that will update every time the spreadsheet is opened, and if possible(doubtful) that will run when new data is entered into the spreadsheet. As far as I know this cant be done with manual execution(with a button) or shortcut keys. If anyone can help me out it would be much apreciated.

Thanks.

#27
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

plettieri

Well-known Member
Joined
Sep 4, 2002
Messages
1,558
Platform
  1. MacOS
This might help for the fisrt part of yr question...taken from a prior post by Kevin


you can do this in either one of two ways:

1. write a macro and name the macro auto_open. the macro will run automatically when the file is opened.

2. place the following code in your 'this workbook' object window in VB editor:

Private Sub Workbook_Open()
'place your code here
End Sub

either of these methods should work


pll
 
Upvote 0

Mudface

MrExcel MVP
Joined
Feb 18, 2002
Messages
3,339
Also, use the Worksheet_Change (or Calculate) events to run code when the contents of the worksheet change.
 
Upvote 0

Forum statistics

Threads
1,195,943
Messages
6,012,431
Members
441,700
Latest member
Warbo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top