#1   Report Post  
Posted to microsoft.public.excel.misc
Rob Rob is offline
external usenet poster
 
Posts: 718
Default relative references

I wish to create a sum formula that references the previous sheet in a
multiple worksheet workbook. I would then like to copy the formula to the
next sheet and maintain the relative refrence to the new previous sheet. Is
it possible to do this without having to change the reference in each sheet?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 772
Default relative references

Not really well without code, but it you put a formula somewhere in each
sheet that gets the prior sheets name and the location of the sum, you can
reference the cell with an indirect. Something like this
=MID(CELL("filename",Sheet1!A1),FIND("]",CELL("filename",A1))+1,256)&"!B2"
Sheet1 being the prior sheet and B2 containing the value
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Rob" wrote:

I wish to create a sum formula that references the previous sheet in a
multiple worksheet workbook. I would then like to copy the formula to the
next sheet and maintain the relative refrence to the new previous sheet. Is
it possible to do this without having to change the reference in each sheet?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default relative references

If you're willing to use a User Defined Function.......

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 use......................

Say you have 12 sheets, sheet1 through sheet12...........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 Fri, 5 Dec 2008 04:12:00 -0800, Rob
wrote:

I wish to create a sum formula that references the previous sheet in a
multiple worksheet workbook. I would then like to copy the formula to the
next sheet and maintain the relative refrence to the new previous sheet. Is
it possible to do this without having to change the reference in each sheet?


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
convert relative cell references to absolute cell references via amacro? Dave F[_2_] Excel Discussion (Misc queries) 1 May 15th 08 04:43 PM
Help with converting a block of cells with Absolute and mixed references to relative references Vulcan Excel Worksheet Functions 3 December 13th 07 11:43 PM
Relative references gcotterl Excel Worksheet Functions 4 June 17th 06 05:23 AM
Relative references GARY Excel Discussion (Misc queries) 7 June 16th 06 10:08 PM
Relative references GARY Excel Discussion (Misc queries) 1 June 16th 06 09:23 PM


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

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

About Us

"It's about Microsoft Excel"