Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 334
Default Auto Update worksheet references as new worksheets are added

I have a workbook where I add a new worksheet each week. Each sheet contains
cells with formulas that reference the worksheet from the previous week.
When I add a new worksheet, I copy the formulas from the previous week, but
it continues to reference the week prior to that. I must manually update
each reference, and it's getting old. Any suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Auto Update worksheet references as new worksheets are added

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 Mon, 12 Jan 2009 11:10:02 -0800, Rick
wrote:

I have a workbook where I add a new worksheet each week. Each sheet contains
cells with formulas that reference the worksheet from the previous week.
When I add a new worksheet, I copy the formulas from the previous week, but
it continues to reference the week prior to that. I must manually update
each reference, and it's getting old. Any suggestions?


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
CAN EXCEL AUTO DATE ADDED WORKSHEETS? Dean W. Excel Worksheet Functions 1 June 6th 08 10:53 PM
how do i auto update cell values after pasting linked references kev Excel Worksheet Functions 0 December 6th 07 05:09 PM
Cell references auto update when sorting Chris Excel Discussion (Misc queries) 3 March 8th 07 04:34 PM
update consolidated sheet when data is added to worksheets prmagpie Excel Discussion (Misc queries) 0 March 1st 06 07:35 PM
Adding a row to worksheet does not update cell references in another. blausen Excel Worksheet Functions 5 February 25th 06 09:14 PM


All times are GMT +1. The time now is 04:52 AM.

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"