View Single Post
  #5   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 ad

And just entering =lastsheet() returns the name of the last sheet, is that
what you want?

Peter

"Joel" wrote:

I think our levels of advancement with this product are not equal, yours
being significantly higher than mine.

What is a UDF?
I see where I have to enter the results of the udf, but where do I define
the UDF?
I don't need to sum or perform any function I just have to display it.

"Billy Liddel" wrote:

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/