简体   繁体   中英

How to copy an Excel sheet with formulas between files?

I have two Excel files: file1 with two Sheets (Sheet1 and Sheet2) and file2 with Sheet3.
Sheets 1 and 3 have the same structure but different data.
Sheet2 contains some formulas referring to Sheet1 like for example "=Sheet1!A1" .

I want to copy Sheet2 to file2 with the same formulas referring to Sheet3, but when I try to copy it, formulas change from "=Sheet1!A1" to "=[file1.xls]Sheet1!A1" .

How can I copy the whole sheet with the same formulas?

I am not sure there is an explicit way to do this, however with some Find/Replace action you can work around this.

After you paste your new formulas into File2, do a find replace ( CTRL + F and select Replace). Replace the file reference [file1.xls]sheet1! with sheet3! and this should remove that link.

While not 100% what you're asking, one way to copy exact formulas over (without changing the file or sheet references) is this:

Alternatively, you can put both the source and destination files into formula view mode (go to Formula on the ribbon --> Show Formulas or press CTRL + ` (key that looks like backwards apostrophe)), then copy and paste the formulas from the first file to the second file, and exit formula view mode.

For your question, if you used this alternate method, you would still need to find/replace Sheet1 with Sheet3 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM