#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Link to previous tab

I have a cell in my worksheet which links to the previous worksheet. i.e I'm
in Nov 08 and the cell looks at a cell in Oct 08 sheet.

Whenever I copy this sheet to create the next month, I have to update the
link to the previous month's sheet. =Oct 08!A4 must be changed to Nov 08!A4.

Can I create a formula which will do =[cell one to the left]!A4?

Thanks

Maria :)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,805
Default Link to previous tab

Try
=INDIRECT("'"&TEXT(MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,256)-31,"mmm yy")&"'!A4")

This will fail in Jan '09, Jan '10 etc. as it does not take care of the year
change. Though it mentions A1 it is not impacted by the value in A1... as
long as the value there is not #ERROR, #N/A etc.

Try to modify it to take care of Year change...

"Ugnz" wrote:

I have a cell in my worksheet which links to the previous worksheet. i.e I'm
in Nov 08 and the cell looks at a cell in Oct 08 sheet.

Whenever I copy this sheet to create the next month, I have to update the
link to the previous month's sheet. =Oct 08!A4 must be changed to Nov 08!A4.

Can I create a formula which will do =[cell one to the left]!A4?

Thanks

Maria :)

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Link to previous tab

If you're willing to use a User Defined Function which ignores sheet names.

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

=PrevSheet(A4)


Gord Dibben MS Excel MVP

On Thu, 30 Oct 2008 16:39:01 -0700, Ugnz
wrote:

I have a cell in my worksheet which links to the previous worksheet. i.e I'm
in Nov 08 and the cell looks at a cell in Oct 08 sheet.

Whenever I copy this sheet to create the next month, I have to update the
link to the previous month's sheet. =Oct 08!A4 must be changed to Nov 08!A4.

Can I create a formula which will do =[cell one to the left]!A4?

Thanks

Maria :)


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
Copy two linked sheets, and update the link isn't to the previous Diann Excel Discussion (Misc queries) 0 October 15th 08 06:30 PM
VBA Link - Previous post unclear robert morris Excel Discussion (Misc queries) 9 May 1st 08 09:57 PM
Previous Documents Cindareli7 Excel Discussion (Misc queries) 3 November 1st 06 07:22 PM
if i sort cell that has link to another page how to keep link steve Bahrain Excel Discussion (Misc queries) 1 August 16th 06 01:20 PM
if i sort cell that has link to another page how to keep link steve Bahrain Excel Discussion (Misc queries) 0 August 16th 06 07:37 AM


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