[英]Excel copying a sheet to another workbook - need named ranges to sync to 2nd workbook
I have a template workbook with multiple sheets, and I added a sheet to the template which includes formulas that refer to cells / named ranges on the other sheets within the workbook.我有一个包含多个工作表的模板工作簿,我向模板添加了一个工作表,其中包含引用工作簿中其他工作表上的单元格/命名范围的公式。 When I copy/paste this new sheet into existing instances of the template workbook, all the cell/formula references remain pointed to the template workbook.
当我将这个新工作表复制/粘贴到模板工作簿的现有实例中时,所有单元格/公式引用仍然指向模板工作簿。 I need them to align with the workbook into which they've been pasted (and already has all the same named ranges, etc).
我需要它们与粘贴它们的工作簿对齐(并且已经具有所有相同的命名范围等)。
So... how to paste a sheet into a different workbook and have the formulas point to cells in the **destination ** workbook rather than the source?那么...如何将工作表粘贴到不同的工作簿中并让公式指向**目标**工作簿中的单元格而不是源? I'd prefer to avoid a VBA solution, but will go there if needed.
我宁愿避免使用 VBA 解决方案,但如果需要,我会使用 go。 Thanks!
谢谢!
The un-named cells are manageable, I can just search/replace in the formulas to remove [Template.xlsm], although I'd prefer to avoid this step.未命名的单元格是可管理的,我可以在公式中搜索/替换以删除 [Template.xlsm],尽管我更愿意避免这一步。 But can't find a way to do this with named cells other than going one by one through the Name Manager, which is not feasible.
但是除了通过名称管理器一个一个地进行之外,找不到对命名单元执行此操作的方法,这是不可行的。
It's hard to understand exactly the dynamics of your sheet without a picture or a link to a file, but try this:如果没有图片或文件链接,很难准确理解工作表的动态,但试试这个:
Create a duplicate source template.创建一个重复的源模板。 We are going to be manipulating this template, so please use only the backup file.
我们将要处理这个模板,所以请只使用备份文件。
For the sheet that you want to copy over from your source to your destination file, hit Ctrl H to open up the search and replace box.对于要从源文件复制到目标文件的工作表,按 Ctrl H 打开搜索和替换框。 In the "Find what", type in the = sign only.
在“查找内容”中,仅键入 = 符号。 Do not put the = sign within quotes like "=".
不要将 = 符号放在引号内,例如“=”。
In the "Replace with" field type in any character eg ^ (I chose this character specifically since it is seldom used in any file).在“替换为”字段中键入任何字符,例如 ^(我特别选择了这个字符,因为它很少在任何文件中使用)。 Make sure to hit the REPLACE ALL button
确保点击 REPLACE ALL 按钮
Now you should see all your formulas should have transformed into text with your character ^ in front of it现在你应该看到你所有的公式都应该已经转换成文本,你的角色 ^ 在它前面
Copy this sheet over to your destination file.将此工作表复制到您的目标文件。
In your destination file, press Ctrl H again to bring up the search and replace box.在目标文件中,再次按 Ctrl H 调出搜索和替换框。
In the "Find What" field, put in your character ^ and in the "Replace With" field put in = without any quotations.在“查找内容”字段中,输入您的字符 ^ 并在“替换为”字段中输入 =,不带任何引号。 Again, make sure to hit the Replace all button that sits on the bottom left of the dialog box.
再次确保点击位于对话框左下角的全部替换按钮。
Your formulas should point towards the internal workbook references您的公式应指向内部工作簿参考
I hope this works for you!我希望这对你有用!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.