Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JLM JLM is offline
external usenet poster
 
Posts: 3
Default How:Add New Worksheet that copies the cell of the previous sheet

I need to add worksheets all the time to a file we use. When I add the
worksheet I want it to automatically take the value of the previous worksheet
and add it to a cell on the new worksheet.

For example:
Step 1) Value in cell B1 on worksheet 1 is 2000. Formula in C1 is =+B1.
There is just one worksheet in the file.

Step 2) I insert new worksheet with exact formatting of worksheet 1. I want
worksheet2 Cell C1 to add cell C1 on worksheet1 to cell B1 on worksheet2.
Basically just rolling the formula to include the previous worksheet. I can
use a simple formula =B1+Sheet1!C1 Result: 3000 (assuming B1 of Worksheet2
is 1000)

Step 3) BUT- Then I want to insert another worksheet(3), again with the
exact same formatting but now I want cellC1 to pick up the the result from
Worksheet 2 Cell C1 and add it to B1 on worksheet3. This without me having to
actually type the formula to read =A2+Sheet!2B3.

I just want the formula to roll forward and include the previous worksheet's
cell. Reason for need: I need the file to be as simple as possible as it will
be used by very junior computer users in Mongolia! I need a new worksheet
every day.

This seems like a no-brainer but I can't figure it out! Does all that make
sense?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How:Add New Worksheet that copies the cell of the previous sheet

The worksheet that is added each day comes from where?

A default sheet template?

A copy of the existing sheet?

If from a sheet template, you could add this UDF to the workbook and place a
formula in the sheet template.

=B1 + PrevSheet(C1)

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


Gord Dibben MS Excel MVP



On Thu, 24 Aug 2006 11:05:02 -0700, JLM wrote:

I need to add worksheets all the time to a file we use. When I add the
worksheet I want it to automatically take the value of the previous worksheet
and add it to a cell on the new worksheet.

For example:
Step 1) Value in cell B1 on worksheet 1 is 2000. Formula in C1 is =+B1.
There is just one worksheet in the file.

Step 2) I insert new worksheet with exact formatting of worksheet 1. I want
worksheet2 Cell C1 to add cell C1 on worksheet1 to cell B1 on worksheet2.
Basically just rolling the formula to include the previous worksheet. I can
use a simple formula =B1+Sheet1!C1 Result: 3000 (assuming B1 of Worksheet2
is 1000)

Step 3) BUT- Then I want to insert another worksheet(3), again with the
exact same formatting but now I want cellC1 to pick up the the result from
Worksheet 2 Cell C1 and add it to B1 on worksheet3. This without me having to
actually type the formula to read =A2+Sheet!2B3.

I just want the formula to roll forward and include the previous worksheet's
cell. Reason for need: I need the file to be as simple as possible as it will
be used by very junior computer users in Mongolia! I need a new worksheet
every day.

This seems like a no-brainer but I can't figure it out! Does all that make
sense?


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
Relative reference to a cell on a previous sheet [email protected] Excel Discussion (Misc queries) 1 July 17th 06 07:27 PM
insert date Larry Excel Worksheet Functions 28 July 15th 06 02:41 AM
Compiling macro based on cell values simonsmith Excel Discussion (Misc queries) 1 May 16th 06 08:31 PM
Custom functions calculating time arguments Help Desperate Bill_De Excel Worksheet Functions 12 April 25th 06 02:22 AM
Adding a row to worksheet does not update cell references in another. blausen Excel Worksheet Functions 5 February 25th 06 09:14 PM


All times are GMT +1. The time now is 10:56 PM.

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"