Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Iolao
 
Posts: n/a
Default referring to previous sheet


I have a list of several sheets, named with numbers (1,2,3,ecc.). I need
some kind of function that allows me to have the value of one cell equal
to that same cell in 1 to 3 sheets before. Example:

sheet5

A3= value of A3 in sheet2 (5-3)

How is that possible?


--
Iolao
------------------------------------------------------------------------
Iolao's Profile: http://www.excelforum.com/member.php...o&userid=16654
View this thread: http://www.excelforum.com/showthread...hreadid=320575

  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default

If your sheets are named "1", "2", rather than your example ("sheet5",
"sheet2"), one way:

=INDIRECT(MID(CELL("filename",A1), FIND("]", CELL("filename", A1))+
1, 255)-3 & "!A3")

Note that the file has to be saved for that to work.



In article ,
Iolao wrote:

I have a list of several sheets, named with numbers (1,2,3,ecc.). I need
some kind of function that allows me to have the value of one cell equal
to that same cell in 1 to 3 sheets before. Example:

sheet5

A3= value of A3 in sheet2 (5-3)

How is that possible?

  #4   Report Post  
Gord Dibben
 
Posts: n/a
Default

Iolao

Copy/paste this User Defined Function to a general module in your workbook.

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

'Enter =PrevSheet(B2) on sheet2 and you'll get B2 from sheet1.

If not familiar with VBA and macros see David McRitchie's site.

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Gord Dibben Excel MVP

On Fri, 26 Nov 2004 08:24:33 -0600, Iolao
wrote:


I have a list of several sheets, named with numbers (1,2,3,ecc.). I need
some kind of function that allows me to have the value of one cell equal
to that same cell in 1 to 3 sheets before. Example:

sheet5

A3= value of A3 in sheet2 (5-3)

How is that possible?


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
Linking to an Entire Sheet Chaplain Doug Links and Linking in Excel 2 December 24th 04 08:39 AM
how can i select all the cells with same color on a sheet if there are multipale colors by vba code uobt Charts and Charting in Excel 1 December 15th 04 06:27 PM
Hyperlink to specific sheet in Excel Web File jd17 Links and Linking in Excel 0 December 8th 04 10:03 PM
Can't save chart as object in current sheet Ann Scharpf Charts and Charting in Excel 1 December 4th 04 12:24 AM
Hyperlinks - identifying source in destination sheet UniDave Excel Discussion (Misc queries) 0 November 25th 04 11:07 PM


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