Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Referring to a worksheet in another file.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 21 Sep 2006 01:22 GMT
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
Ronald Dodge - 21 Sep 2006 15:30 GMT
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.

Signature

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

> Hi
> I need the Macro coding that will calculate cell(s) in another file.
[quoted text clipped - 4 lines]
> Thankyou
> Ed
Ed - 22 Sep 2006 01:50 GMT
Hi Ronald
Thankyou, you solved my problem.
Ed

> Syntax:
>
[quoted text clipped - 35 lines]
> > Thankyou
> > Ed
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.