View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Billy Liddel Billy Liddel is offline
external usenet poster
 
Posts: 527
Default automatically change the worksheet reference when new sheet added

Joel

You will have to add the new sheet to the end of the workbook and use this
UDF. It just return the name of the last sheet in the book.

Function Lastsheet()
ns = Sheets.Count
Lastsheet = Worksheets(ns).Name & "!"
End Function

In a blank cell, say B1 enter the formula
=lastsheet()&"B4:B14"
where B4:B14 is the range you wish to examine.

Then if you want to sum this range use the formula =SUM(INDIRECT(B1))

Hope this helps

Peter Atherton

"Joel" wrote:

I maintain inventory on a spreadsheet. I am making a reference to a range of
cells. I add a new worksheet for each new day. I would like the reference
to point to the last day added rather then what I do now which is point to a
tab name then then rename it.

Is there a way that references and external references to can change
dynamically whenver a new sheet is added to the source workbook/