Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Autofilter Lists across Multiple Sheets, Maintain Correct Referenc | Excel Worksheet Functions | |||
In 3 active sheets in wkbk, determine& display the # of sheets that have data | Excel Discussion (Misc queries) | |||
Calculating average scores from multiple sheets' information | Excel Worksheet Functions | |||
calculating excel spreadsheet files for pensions and life insurance (including age calculation sheets) | Excel Worksheet Functions | |||
AGE CALCULATING EXCEL SPREADSHEETS AND OTHERS! | Excel Discussion (Misc queries) |