Excel - 比较两个文档?
我正在尝试将两本 Excel 书籍链接在一起。它们是彼此的精确副本,但如果您编辑其中一个,另一个也应该得到更新。我知道您可以使用链接功能来做到这一点,但这是单向的。我需要知道如何在两个方向上做到这一点。
Book1.xls
Sheet1
A1: Hello!
A2: Goodbye!
Book2.xls
Sheet1
A1: Hello!
A2: Goodbye!
现在,如果我在 Book2 和 Book1 之间有链接,则在 Book1 中编辑的任何内容都将在 Book2 中更改,但反之则不然!
谢谢你!!
I'm trying to link two Excel books together. They are an exact copy of each other, but if you edit either one, the other should get updated too. I know you can do this using the link function, but that's unidirectional. I would need to know how you can do this in both directions.
Book1.xls
Sheet1
A1: Hello!
A2: Goodbye!
Book2.xls
Sheet1
A1: Hello!
A2: Goodbye!
Now if I have a link between Book2 and Book1, anything edited in Book1 will be changed in Book2, but not vice versa!
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个问题 - 如果文件是精确的副本,为什么有 2 个副本?
一个可能的示例是使用 Workbook_SheetChange 事件,以便对工作簿的任何更改都会更新其他工作簿。但是,这实际上仅在您更改值而不是格式等时才有效。
例如 2 个工作簿 Book1.xlsm 和Book2.xlsm,在 THISWORKBOOK 对象的 Book1.xlsm 中输入
在 Book2.xlsm 中执行相同操作,但更改
strCopyto = "C:\Users\osknows\Desktop\Book1.xlsm"
这是多种方法之一可以做到
One question - if the files are meant to be exact copies why have 2 copies?
A possible example is to use a Workbook_SheetChange event so that any changes to a workbook update the other workbook. However, this really only works when you change values and not formats etc.
Eg 2 workbooks Book1.xlsm & Book2.xlsm, in Book1.xlsm in THISWORKBOOK object enter
do the same in Book2.xlsm but change
strCopyto = "C:\Users\osknows\Desktop\Book1.xlsm"
this is one of many ways it could be done