Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PH NEWS
 
Posts: n/a
Default calculating sheets

Hi All,

I'm trying to calculate a certain selection of sheets all in one go, the
sheets I want to calculate change on a daily basis. Basically, I want to
pick, say, sheet1, sheet4, sheet7, etc, and then calculate them at the same
time.
I have ASAP on my machine and use the "print multiple sheets" function,
however the "calculate the sheets to be printed" button doesn't seem to
work.
Can anyone help?


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default calculating sheets

You can do this with VBA, my modifying the line below sh=Array(...)

Sub CalcSheets()
Dim sh As Variant
sh = Array("Sheet1", "Sheet2", "Sheet3")
For i = LBound(sh) To UBound(sh)
Sheets(sh(i)).Calculate
Next i
End Sub

To install:
Alt+F11 to go to the VBA IDE
Insert|Module
Paste the code above.

To run:
Alt+F8.
Choose CalcSheets
Or you can put a button on a worksheet. When you draw it, Excel will
ask you which macro to assign. Select this macro.

HTH
Kostis Vezerides

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PH NEWS
 
Posts: n/a
Default calculating sheets

Thank you, but won't I have to change the code each time the sheets I want
to calculate change? For example one week I may want to calculate sheets 3
and 6 and the next week I want to calculate sheets 2, 4, 7 and 10. Is there
a way a can select the relevant sheets and then calculate?


"vezerid" wrote in message
oups.com...
You can do this with VBA, my modifying the line below sh=Array(...)

Sub CalcSheets()
Dim sh As Variant
sh = Array("Sheet1", "Sheet2", "Sheet3")
For i = LBound(sh) To UBound(sh)
Sheets(sh(i)).Calculate
Next i
End Sub

To install:
Alt+F11 to go to the VBA IDE
Insert|Module
Paste the code above.

To run:
Alt+F8.
Choose CalcSheets
Or you can put a button on a worksheet. When you draw it, Excel will
ask you which macro to assign. Select this macro.

HTH
Kostis Vezerides



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default calculating sheets

Create a new management sheet in the same workbook. Select a column,
say A:A, for this purpose. Use cells A1, A2, ... every week to write
the sheets to be calculated. My modified code assumes you will call
this sheet MGMT and that you will start your cells from column A:A.
Then use this variant:

Sub CalcSheets()
i = 1
While Sheets("MGMT").Cells(i, "A") < ""
Sheets(Cells(i, "A")).Calculate
i = i + 1
Wend
End Sub

Any better?

Kostis Vezerides

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid
 
Posts: n/a
Default calculating sheets

Sorry, one minor change, to avoid possible errors:

Sub CalcSheets()
i = 1
While Sheets("MGMT").Cells(i, "A") < ""
Sheets(Sheets("MGMT").Cells(i, "A")).Calculate
i = i + 1
Wend
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PH NEWS
 
Posts: n/a
Default calculating sheets

It looks like that is exactly what I want, however I'm having problems
running it. When I click the run button there is an error message which says
Type Mismatch. Is there anything I can do?

SPL


"vezerid" wrote in message
oups.com...
Sorry, one minor change, to avoid possible errors:

Sub CalcSheets()
i = 1
While Sheets("MGMT").Cells(i, "A") < ""
Sheets(Sheets("MGMT").Cells(i, "A")).Calculate
i = i + 1
Wend
End Sub



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
Autofilter Lists across Multiple Sheets, Maintain Correct Referenc EDSTAFF Excel Worksheet Functions 0 November 14th 05 03:27 PM
In 3 active sheets in wkbk, determine& display the # of sheets that have data wrpalmer Excel Discussion (Misc queries) 1 November 4th 05 02:01 PM
Calculating average scores from multiple sheets' information quailhunter Excel Worksheet Functions 2 October 16th 05 10:37 PM
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) RICHARD Excel Worksheet Functions 1 March 15th 05 05:49 PM
AGE CALCULATING EXCEL SPREADSHEETS AND OTHERS! RICHARD Excel Discussion (Misc queries) 0 March 1st 05 01:53 PM


All times are GMT +1. The time now is 03:06 PM.

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"