Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Referring to a worksheet in another file.

Hi
I need the Macro coding that will calculate cell(s) in another file.
Can it be done if this other file is also on the computer screen?
Can it be done if this other file is not also on the computer screen?

If either or both can be done, what is the Macro codings?
Thankyou
Ed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 111
Default Referring to a worksheet in another file.

Syntax:

Dim I as Long
With Workbooks("Book1.xls")
For I = 1 to .Worksheets.Count Step 1
.Worksheets(I).Calculate
Next I
End With

Remarks:

The above code calculates each sheet one by one starting from the first
sheet to the last sheet. I also assumes that no worksheet is dependent on
some value of another worksheet later in the workbook, so if this isn't the
case, then the code would need to be modified to specify the order of the
worksheets to be calculated.

The other option to force a full calculation of everything would be the one
line code below:

Application.CalculateFullRebuild

Instead of the question being does it need to be on the computer screen, the
real question should be, "Does it need to be open?"

The workbook does need to be open within Excel, but it does not need to be
visible on the screen itself.

For more information on how to open workbooks via code, look at the Open
Method on the Workbooks Collection.

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000

"Ed" wrote in message
...
Hi
I need the Macro coding that will calculate cell(s) in another file.
Can it be done if this other file is also on the computer screen?
Can it be done if this other file is not also on the computer screen?

If either or both can be done, what is the Macro codings?
Thankyou
Ed



  #3   Report Post  
Posted to microsoft.public.excel.programming
Ed Ed is offline
external usenet poster
 
Posts: 279
Default Referring to a worksheet in another file.

Hi Ronald
Thankyou, you solved my problem.
Ed

"Ronald Dodge" wrote:

Syntax:

Dim I as Long
With Workbooks("Book1.xls")
For I = 1 to .Worksheets.Count Step 1
.Worksheets(I).Calculate
Next I
End With

Remarks:

The above code calculates each sheet one by one starting from the first
sheet to the last sheet. I also assumes that no worksheet is dependent on
some value of another worksheet later in the workbook, so if this isn't the
case, then the code would need to be modified to specify the order of the
worksheets to be calculated.

The other option to force a full calculation of everything would be the one
line code below:

Application.CalculateFullRebuild

Instead of the question being does it need to be on the computer screen, the
real question should be, "Does it need to be open?"

The workbook does need to be open within Excel, but it does not need to be
visible on the screen itself.

For more information on how to open workbooks via code, look at the Open
Method on the Workbooks Collection.

--
Ronald R. Dodge, Jr.
Production Statistician/Programmer
Master MOUS 2000

"Ed" wrote in message
...
Hi
I need the Macro coding that will calculate cell(s) in another file.
Can it be done if this other file is also on the computer screen?
Can it be done if this other file is not also on the computer screen?

If either or both can be done, what is the Macro codings?
Thankyou
Ed




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
Referring to cells on a different worksheet GARY Excel Discussion (Misc queries) 3 November 10th 09 12:24 AM
formula referring to a worksheet Nicawette Excel Worksheet Functions 4 August 6th 09 09:54 AM
referring a worksheet lazmanyak Excel Worksheet Functions 1 July 23rd 05 02:55 PM
referring to other worksheet Geetu M Excel Worksheet Functions 2 March 29th 05 09:37 PM
Referring to a worksheet using variable WSF Excel Programming 5 January 20th 04 03:16 PM


All times are GMT +1. The time now is 02:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"