×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

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.

RE: Copy formula

If this is repetitive, you can create a macro.

TTFN

RE: Copy formula

There is a way to reference sheet names indirectly. I can't remember how exactly, it needed a bit of lateral thinking.

Cheers

Greg Locock

Please see FAQ731-376 for tips on how to make the best use of Eng-Tips.

RE: Copy formula

Let's try this again . . .

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

Note that the "A1" COLUMN(A1) in the first formula will result in the first result (in cell A3) being read from Sheet1, and is appropriate if the summary is being written in the last sheet of the workbook rather than the first.  If your summary is on Sheet1 and the subtotal data sheets start at Sheet2, cell A2 should instead read in part COLUMN(B1); or COLUMN(C1) if the subtotals start in Sheet3, etc.

Norm

RE: Copy formula

(OP)
Cheers NormPeterson. This works a treat.

RE: Copy formula

(OP)

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!