ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Worksheets in series (https://www.excelbanter.com/excel-discussion-misc-queries/77310-worksheets-series.html)

ben simpson

Worksheets in series
 
What would be the easiest, and/or best way to make exact copies of my
worksheets so the totals from the first will be forwarded onto the next, so I
can keep a running total from page to page? Right now I have used the
copypastelink cells method, but I manually have to update each link to
refer to the last page used, and not the first.Thanks again.....Ben

Carole Drake

Worksheets in series
 
Just linking to your quest in hopes of a reply...(~;

"ben simpson" wrote:

What would be the easiest, and/or best way to make exact copies of my
worksheets so the totals from the first will be forwarded onto the next, so I
can keep a running total from page to page? Right now I have used the
copypastelink cells method, but I manually have to update each link to
refer to the last page used, and not the first.Thanks again.....Ben


Gord Dibben

Worksheets in series
 
Ben/Carole

Here's a User Defined Function to store in a General Module.

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

Group sheet2 through sheetx and in A1(or your choice) enter the formula

=PrevSheet(L16) to replicate across sheets.

DO NOT FORGET to ungroup sheets when done.

If not familiar with VBA and macros, see David McRitchie's site for more 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.

Enter the formula as instructed above.


Gord Dibben Excel MVP




On Thu, 16 Mar 2006 16:15:27 -0800, Carole Drake
wrote:

Just linking to your quest in hopes of a reply...(~;

"ben simpson" wrote:

What would be the easiest, and/or best way to make exact copies of my
worksheets so the totals from the first will be forwarded onto the next, so I
can keep a running total from page to page? Right now I have used the
copypastelink cells method, but I manually have to update each link to
refer to the last page used, and not the first.Thanks again.....Ben


Gord Dibben MS Excel MVP

Carole Drake

Worksheets in series
 
Biig Siiiigh!
OK, I think I copied it and followed the instructions, but if I enter
=PrevSheet(B2) on sheet2, what it does is give me the formula =PrevSheet(B2)
on sheet1 and what shows is each is #NAME?

What am I doing wrong? Can you tell?

"Gord Dibben" wrote:

Ben/Carole

Here's a User Defined Function to store in a General Module.

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

Group sheet2 through sheetx and in A1(or your choice) enter the formula

=PrevSheet(L16) to replicate across sheets.

DO NOT FORGET to ungroup sheets when done.

If not familiar with VBA and macros, see David McRitchie's site for more 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.

Enter the formula as instructed above.


Gord Dibben Excel MVP




On Thu, 16 Mar 2006 16:15:27 -0800, Carole Drake
wrote:

Just linking to your quest in hopes of a reply...(~;

"ben simpson" wrote:

What would be the easiest, and/or best way to make exact copies of my
worksheets so the totals from the first will be forwarded onto the next, so I
can keep a running total from page to page? Right now I have used the
copypastelink cells method, but I manually have to update each link to
refer to the last page used, and not the first.Thanks again.....Ben


Gord Dibben MS Excel MVP



All times are GMT +1. The time now is 06:46 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com