Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 97
Default How do you do the following using VBA macro automatically?

Hi all,

I would like to have the following run every time when the Excel 2003
sheet is opened:

so I am going to put the VBA macro into AUTO_RUN function...

Now when the Excel 2003 file is opened,

I need the following:

1. refresh/recalculate all the sheets in the Excel 2003 file;
2. save all the sheets;
3. close out the file.

Please help me translate these into VBA/MACRO... thanks a lot!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do you do the following using VBA macro automatically?

Excel has no AUTO_RUN function.

Did you mean Auto_Open?

I would put this code into Thisworkbook Module.

Private Sub Workbook_Open()
Application.Calculate
With ThisWorkbook
.Save
.Close
End With
End Sub

But note...............you will have to disable events if you ever want to
keep the workbook open for editing.


Gord Dibben MS Excel MVP

On Tue, 4 May 2010 12:13:34 -0700 (PDT), LunaMoon
wrote:

Hi all,

I would like to have the following run every time when the Excel 2003
sheet is opened:

so I am going to put the VBA macro into AUTO_RUN function...

Now when the Excel 2003 file is opened,

I need the following:

1. refresh/recalculate all the sheets in the Excel 2003 file;
2. save all the sheets;
3. close out the file.

Please help me translate these into VBA/MACRO... thanks a lot!


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
macro run automatically Daniel Excel Discussion (Misc queries) 1 August 3rd 07 03:00 PM
Automatically Run macro Anift Setting up and Configuration of Excel 2 November 25th 06 02:52 PM
Automatically run a macro SheriTingle Excel Discussion (Misc queries) 2 July 12th 05 04:41 PM
Macro to automatically run Pam C Excel Discussion (Misc queries) 1 May 5th 05 02:35 PM
Automatically run Macro tamato43 Excel Discussion (Misc queries) 0 March 30th 05 03:51 PM


All times are GMT +1. The time now is 10:26 AM.

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"