ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Multiple Worksheet (https://www.excelbanter.com/new-users-excel/221172-multiple-worksheet.html)

Bearcat Fan

Multiple Worksheet
 
I am not sure if this will make sense but I am trying to have worksheets to
connect. I will have 52 worksheets with week 1 and so on. And then in my
worksheets I will have a name and how many hours they are at a certain place
from Monday to Friday. So then in worksheet 2 and so on I want the hours to
add up from week to week on each of the 52 worksheets. If you anyone could
help me that would be great and thanks.

Gord Dibben

Multiple Worksheet
 
Copy/paste this UDF to a general module in your workbook.

Function PrevSheet(rg As Range)
n = Application.Caller.Parent.Index
If n = 1 Then
PrevSheet = CVErr(xlErrRef)
ElseIf TypeName(Sheets(n - 1)) = "Chart" Then
PrevSheet = CVErr(xlErrNA)
Else
PrevSheet = Sheets(n - 1).Range(rg.Address).Value
End If
End Function

Example of usage...................

Say you have 12 sheets, sheet1 through sheet52...........sheet names don't
matter.

In sheet1 you have a formula in A10 =SUM(A1:A9)

Select second sheet and SHIFT + Click last sheet

In active sheet A10 enter =SUM(PrevSheet(A10),A1:A9)

Ungroup the sheets.

Each A10 will have the sum of the previous sheet's A10 plus the sum of the
current sheet's A1:A9


Gord Dibben MS Excel MVP

On Mon, 16 Feb 2009 09:57:03 -0800, Bearcat Fan <Bearcat
wrote:

I am not sure if this will make sense but I am trying to have worksheets to
connect. I will have 52 worksheets with week 1 and so on. And then in my
worksheets I will have a name and how many hours they are at a certain place
from Monday to Friday. So then in worksheet 2 and so on I want the hours to
add up from week to week on each of the 52 worksheets. If you anyone could
help me that would be great and thanks.



Don Guillett

Multiple Worksheet
 
Why not just have ONE worksheet with a column for the week and then use
datafilterautofilter to filter as desired.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Bearcat Fan" <Bearcat
wrote in message
...
I am not sure if this will make sense but I am trying to have worksheets to
connect. I will have 52 worksheets with week 1 and so on. And then in my
worksheets I will have a name and how many hours they are at a certain
place
from Monday to Friday. So then in worksheet 2 and so on I want the hours
to
add up from week to week on each of the 52 worksheets. If you anyone
could
help me that would be great and thanks.




All times are GMT +1. The time now is 10:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com