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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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
Also, use the Worksheet_Change (or Calculate) events to run code when the contents of the worksheet change.
 
Upvote 0

Forum statistics

Threads
1,214,387
Messages
6,119,222
Members
448,877
Latest member
gb24

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
Back
Top