Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referring to cells on a different worksheet | Excel Discussion (Misc queries) | |||
formula referring to a worksheet | Excel Worksheet Functions | |||
referring a worksheet | Excel Worksheet Functions | |||
referring to other worksheet | Excel Worksheet Functions | |||
Referring to a worksheet using variable | Excel Programming |