简体   繁体   中英

Copying sheet from one workbook to another workbook formula are not recalculating

I checked the previous similar posts but couldnt find an answer for my issue.

I have an Excel file A where the code consist of :

  • Ask a user to choose a file B via OpenDialogBox -ok
  • Copy a sheet from file A to file B -ok

The problem is that all formulas display '#VALUE!" and I need to double-click on each of the cells to get the result.

I tried this

ActiveSheet.EnableCalculation = True

ActiveSheet.Calculate

and I even tried directly via Excel Calculate Now in Formula Tab.

It doesnt work.

One approach I have used in the past:

  1. replace “=“ with xyxy

  2. copy all cells or move / duplicate sheet to new workbook

  3. replace xyxy with “=“

This allows all the formulae to be transferred as text and then when the xyxy to = replacement is done all the formulae get recalculated anyway.

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