Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Reference previous page

I need to make a workbook with 52 pages (1 for each week) that looks at the
previous page and updates accordingly. Right now, when I create a new page I
have been using find/replace to replace all page references to the correct
page. This is very time consuming and I am hoping to make it quicker as I
have to make 12 files this same way - one for each person.
Any suggestions will be greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Reference previous page

Sounds like you could use Walkenbach's SheetOffset function
http://www.j-walk.com/ss/excel/tips/tip63.htm



"Lori Switzer" wrote:

I need to make a workbook with 52 pages (1 for each week) that looks at the
previous page and updates accordingly. Right now, when I create a new page I
have been using find/replace to replace all page references to the correct
page. This is very time consuming and I am hoping to make it quicker as I
have to make 12 files this same way - one for each person.
Any suggestions will be greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Reference previous page

Lori

You can EditReplace after the fact to change the sheet name which is probably
easiest.

If you're willing to use a User Defined Function.......


Function PrevSheet(rg As Range)
'Enter =PrevSheet(B1) on sheet2 and you'll get B1 from sheet1.
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

Say you have 12 sheets, sheet1 through sheet12.

Select sheet2 and SHIFT + Click sheet12

In B1 enter =PrevSheet(A1)

Ungroup the sheets.

Each B1 will have the contents of the previous sheet's A1

Copy/paste the UDF above into a General Module in your workbook.

If not familiar with macros and VBA, visit David McRitchie's website on
"getting started".

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

In the meantime..........

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the above code in there. Save the
workbook and hit ALT + Q to return to your workbook.


Gord Dibben Excel MVP

On Fri, 22 Sep 2006 16:51:02 -0700, Lori Switzer
wrote:

That looks like what I need, but I have to admit I have never worked with
macros. I have typed the SHEETOFFSET Function into a new module in the
visual basic window, but I wonder if I am saving it wrong, or if it needs
compiling or linking or something because when I try to use the function in
the spreadsheet it gives me "#VALUE! ".

"JMB" wrote:

Sounds like you could use Walkenbach's SheetOffset function
http://www.j-walk.com/ss/excel/tips/tip63.htm



"Lori Switzer" wrote:

I need to make a workbook with 52 pages (1 for each week) that looks at the
previous page and updates accordingly. Right now, when I create a new page I
have been using find/replace to replace all page references to the correct
page. This is very time consuming and I am hoping to make it quicker as I
have to make 12 files this same way - one for each person.
Any suggestions will be greatly appreciated.


Gord Dibben MS Excel MVP
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
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Can a chart reference the local page Mike H Charts and Charting in Excel 3 May 30th 06 12:58 AM
how to print a page many times but add a unique reference on each ms_540 Excel Worksheet Functions 1 April 6th 06 07:42 PM
Page Break Problem top.jimmy Excel Worksheet Functions 6 February 27th 06 10:21 PM
How to reference to the previous worksheet regardless of title? SeabeePlumber Excel Worksheet Functions 0 July 15th 05 11:05 AM


All times are GMT +1. The time now is 04:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"