A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Multiple Worksheet



 
 
Thread Tools Display Modes
  #1  
Old February 16th, 2009, 05:57 PM posted to microsoft.public.excel.newusers
Bearcat Fan
external usenet poster
 
Posts: 1
Default 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.
  #2  
Old February 16th, 2009, 06:43 PM posted to microsoft.public.excel.newusers
Gord Dibben
external usenet poster
 
Posts: 20,252
Default 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.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:21 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.