Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Referencing Worksheets from Cell Values

Thanks in advance to anyone that can help me here.

I have a workbook that will have a varying amount of sheets with
different names. The range in # of sheets will be 2-10. What I need
to do is use the formula =MIN(Sheet1:Sheet2!A1) where A1 is the cell
in each of the sheets prior to the one I am on, so that I can get the
minimum from the that cell value for each of the sheets. The problem
here is that I want the Sheet1:Sheet2 to not be static, but work based
on values in one or two cells (however it needs to work). I have
formulas that can give me the 1st sheet name and the next to last
sheet name perfectly (the last sheet will be the one for which I will
be running the Min formulas, etc).

Can this be done? Even if I was only able to build a formula that
could pull the information from the sheets preceding the one I was on
(the active one), that would work too.

Let me know if you need more information. Help is greatly
appreciated.

Conor
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Referencing Worksheets from Cell Values

Function min_to_here() As Variant
Application.Volatile
Dim s As String
min_to_here = Sheets(1).Range("A1").Value
s = Application.Caller.Parent.Name
For i = 2 To Sheets.Count
If Sheets(i).Name = s Then
Exit Function
End If
If Sheets(i).Range("A1").Value < min_to_here Then
min_to_here = Sheets(i).Range("A1").Value
End If
Next
End Function

We get the name of the sheet on which the function is located. We then
examine the A1's on the sheets up to that sheet.
--
Gary''s Student - gsnu2007b


" wrote:

Thanks in advance to anyone that can help me here.

I have a workbook that will have a varying amount of sheets with
different names. The range in # of sheets will be 2-10. What I need
to do is use the formula =MIN(Sheet1:Sheet2!A1) where A1 is the cell
in each of the sheets prior to the one I am on, so that I can get the
minimum from the that cell value for each of the sheets. The problem
here is that I want the Sheet1:Sheet2 to not be static, but work based
on values in one or two cells (however it needs to work). I have
formulas that can give me the 1st sheet name and the next to last
sheet name perfectly (the last sheet will be the one for which I will
be running the Min formulas, etc).

Can this be done? Even if I was only able to build a formula that
could pull the information from the sheets preceding the one I was on
(the active one), that would work too.

Let me know if you need more information. Help is greatly
appreciated.

Conor

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Referencing Worksheets from Cell Values

No need to get too fancy here. The formula that you have will look at Sheet1
and Sheet2 and all sheets in between. So so long as any new sheets are added
inbetween the sheets listed in the fromula you are good to go. To that end
you want to add a couple of Dummy sheets to your workbook. Call them Start
and End (or whatever) Place them ahead of sheet 1 and after sheet2. Change
your formula to
=MIN(Start:End!A1)
You may need to spike the values in start and end so that they are not the
minimums. Now hide the Start and End sheets. When new sheets are added they
should land between start and end and since start and end are hidden you do
not have to worry about users moving them (generateing wrong answers) or
deleteing them (invalidating the formulas).
--
HTH...

Jim Thomlinson


" wrote:

Thanks in advance to anyone that can help me here.

I have a workbook that will have a varying amount of sheets with
different names. The range in # of sheets will be 2-10. What I need
to do is use the formula =MIN(Sheet1:Sheet2!A1) where A1 is the cell
in each of the sheets prior to the one I am on, so that I can get the
minimum from the that cell value for each of the sheets. The problem
here is that I want the Sheet1:Sheet2 to not be static, but work based
on values in one or two cells (however it needs to work). I have
formulas that can give me the 1st sheet name and the next to last
sheet name perfectly (the last sheet will be the one for which I will
be running the Min formulas, etc).

Can this be done? Even if I was only able to build a formula that
could pull the information from the sheets preceding the one I was on
(the active one), that would work too.

Let me know if you need more information. Help is greatly
appreciated.

Conor

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
Cell Referencing between multiple worksheets Nelson B. Excel Discussion (Misc queries) 4 July 24th 09 08:55 AM
Cell referencing between differnt worksheets John Excel Discussion (Misc queries) 3 December 21st 07 07:52 PM
Referencing Named Ranges using values in a cell eggman Excel Discussion (Misc queries) 2 September 23rd 06 06:30 PM
referencing same cell in several worksheets coriolis Excel Discussion (Misc queries) 2 May 20th 06 12:51 AM
referencing values in adjacent cells to selected cell Darren Haslett Excel Programming 3 February 23rd 04 05:45 PM


All times are GMT +1. The time now is 06:35 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"