Copy formula
Copy formula
(OP)
Hi all,
Just wondering if anybody knows an easy way of copying formula across a sheet, which has links to other sheets in the workbook.
What I have is a summry page, which links sub totals from ohter sheets. What I would like to do is copy this to the cell next door, but have the sheet reference change, i.e cell A1 = subtotal of cell A2 from sheet2 - then copy this to cell B1 = subtotal of cell A2 from sheet3.
Any ideas of how (or if) this can be done.
At present I have to manullay change the sheet reference which can be very time consuming if there are 30-40 sheets.
Thanks in advance
Just wondering if anybody knows an easy way of copying formula across a sheet, which has links to other sheets in the workbook.
What I have is a summry page, which links sub totals from ohter sheets. What I would like to do is copy this to the cell next door, but have the sheet reference change, i.e cell A1 = subtotal of cell A2 from sheet2 - then copy this to cell B1 = subtotal of cell A2 from sheet3.
Any ideas of how (or if) this can be done.
At present I have to manullay change the sheet reference which can be very time consuming if there are 30-40 sheets.
Thanks in advance





RE: Copy formula
TTFN
RE: Copy formula
Cheers
Greg Locock
Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
RE: Copy formula
You can use indirect addressing, but you'll need to create another row to generate the sheet names. Assuming that the sheets retain Excel's default naming scheme, write the first formula in cell A2 and copy it across as required. The column(A1) function will take the drudgery out of indexing the sheet number. Then write the second formula in cell A3 and copy this as required. The "$A$2" part of this formula is, of course, the common cell address for the subtotals in the sheets, so absolute referencing of at least the column letter is necessary here. I'd avoid putting either formula in the row that the column() function in the first formula refers to, just to avoid possible circular reference issues.
="Sheet"&TEXT(COLUMN(A1),"0")&"!"
=INDIRECT(A2&"$A$2")
A similar technique can be used to grab data from several completely separate workbooks, although I think all the workbooks would need to be open.
Norm
RE: Copy formula
Norm
RE: Copy formula
RE: Copy formula
I have a formula (from a previous question of mine) that calls up the worksheet name. This being:
=MID(CELL("FILENAME",A5),FIND("]",CELL("FILENAME",A5))+1,256)
However this only refers to the current worksheet name, is there any way this can be put on say Sheet1, to reference the name of Sheet2, Sheet3 etc. This would elimate (in around about ways) of the first formula in Norms post, and would enable the renaiming of worksheets?
Thanks