Can I copy consecutive formulas to different worksheet

DayDay

Board Regular
Joined
Jan 30, 2007
Messages
64
Hi, I'm having a problem.

Is there a way to copy a consecutive formula to seperate worksheets within a workbook

for example

I have 32 tabs ('Total','1','2','3','4','5'... etc) 1-31 being seperate dates.

I want to have Cell A1 in worksheet 'Total' to read the current month & year, so i have the cell value as 1/1/08 (farmatted to read January 2008)

I want cell A1 in each consecutive worksheet to read the date (plus 1 day)

So
worksheet '1' A1=Total!A1
worksheet '2' A1=1!A1+1
worksheet '3' A1=2!A1+1
worksheet '4' A1=3!A1+1
......

or

worksheet '1' A1=Total!A1
worksheet '2' A1=Total!A1+1
worksheet '3' A1=Total!A1+2
worksheet '4' A1=Total!A1+3
......

my question is can I have excel fill this consecutive formula without having to change each A1 cell to read the previous worksheets name?

Just a time consuming process I would like to reduce.

Cheers
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi

Here's one (non-VBA) way:

1. Define a name and call it ShtNm. In refers to:

=REPLACE(CELL("filename",!$A$1),1,FIND("]",CELL("filename",!$A$1)),"")

2. Define a second name and call it ShtNo. In refers to:

=GET.DOCUMENT(87,ShtNm)

3. In your sheets, in A1 type:

=Total!$A$1+ShtNo-1
 
Upvote 0
Hi Richard, many thanks for your explanation.
However, I do not fully understand.

nothing you have done wrong I'm just new to the GET.DOCUMENT and in fact REPLACE commands. Could you just explain in slightly mopre detail what they refer to.
 
Upvote 0
GET.DOCUMENT is an old XLM4 macro function which used to be used in Excel on a regular basis in xl95 (ie before the advent of the joy that is VBA ;)). They can still be used in workbooks but only in defined names, not in worksheet cells. The 87 in the first argument of GET.DOCUMENT tells the function we want the sheet count number, the second argument needs to be the sheet name of the sheet we want the count for. We get this from another defined name using Replace:

=CELL("filename",$A$1)

returns the full workbook name and path and sheet name of the referenced cell (ie A1). We only want the sheet name part, so we need to remove the path & workbook name. We do this using REPLACE. We know that a workbook name/path will be in the formta:

C:\myFolder\[myFile.xls]Sheet1

The closing square bracket will always be present (unless the workbook hasn't been saved ever), so we just need to locate the ] and use that as a marker. We use REPLACE to replace from the 1st character up to the position of the ] bracket with an empty string:

=REPLACE(CELL("filename",!$A$1),1,FIND("]",CELL("filename",!$A$1)),"")

which just leaves us with the sheet name, which we can use in our XLM4 name.

Make sense?
 
Upvote 0
Wow Richard, thanks for taking the time to explain.
It does make sense. I appreciate it. :)

I was also wondering if it was possible to "drag" formulae over worksheets somehow.

I.e. Typing in consecutive cells 1, 2, 3... and then dragging the formula to autofill

can I autofill over multiple worksheets in some way without VBA?
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top