如何将多个 Excel 文件链接到一个主文件,以便如果我更新单个主文件,所有链接的文件也会更新?

发布于 2024-11-08 11:21:00 字数 806 浏览 0 评论 0原文

我想知道是否有人可以帮忙?

我有大量的 Excel 文件。这些是佣金报表,有些是从美元转换为英镑,从英镑转换为欧元等。

它们是季度报表,目前我必须逐一浏览每个文件并输入该月的具体货币兑换率。

我想如果我能将所有这些语句链接到一个包含转换率的 Excel 文件,那就太好了。然后我可以更新这个单一货币转换文件,所有其他文件都会更新。

我想我可以解决这个问题,但是我遇到了一个小问题。

如果我随后将报表文件发送给个人,两个文件之间的本地链接将丢失,因此转换数字也将丢失。我能看到的唯一解决方法是发送包含转换率的文件以及声明,但如果可能的话我宁愿不这样做。

我希望您能理解我的问题,如果有人能提出解决此问题的建议,那就太好了!

提前致谢:o)

我在这里得到了一些关于在所有 Excel 文件中包含隐藏费率表的建议:

链接来自 2 个不同 Excel 文件的单元格,但如果仅通过电子邮件发送一个文件,则保留数字?

然后可以将可见工作表中的费率链接到隐藏费率表中的单元格然后隐藏费率表可以链接到单独的单个主费率文件,我将更改该文件以更新所有链接的 Excel 文件上的费率。

我仍然有点不确定如果我要通过电子邮件向人们发送单个 Excel 文件,这将如何工作,因为主费率文件的本地链接将会丢失。有工作环境吗?

任何帮助将非常非常感激!

I'm wondering if anybody can help?

I have a large number of excel files. These are commission statements and some are converted from USD to UK Sterling, from UK sterling to Euros etc etc.

They are quarterly statemnets and at present I have to go through each file one by one and enter in the specific currency conversion rates for that month.

I was thinking it would be great if I could link all these statements to a single excel file which contained the conversion rates. I could then update this single currency conversion file and all the other files would update.

I think I could manage this, but there is a little problem I have ran into.

If I then send the statement files out to individuals, the local link between the two files would be lost and therefore, surly so would the conversion figures. The only fix I can see would be to send the file containing the conversion rates along with the statement, but if possible I would prefer not to do this.

I hope you can understand my problem and it would be great if anybody could suggest any fixes to this!

Thanks in advance :o)

I have had some advice here about including a hidden rates sheet in all excel files:

Linking cells from 2 different excel files, but then keeping figures if emailing only one file?

The rates within the visible sheets could then be linked to the cells in the hidden rates sheet and then the hidden rates sheet could be linked to a seperate single master rates file, which I would alter to update rates on all linked excel files.

I' still a bit unsure on how this would work if I was to send a single excel file to people in an email, because the local link to the master rates file would be lost. Is there a work arround?

Any help would be really really appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

一种方法是将您的主汇率工作簿放在网络上。

您的报表工作簿可以通过公式引用网络上的主工作簿。例如:

='http://www.your-site.com/test/[Workbook1.xls]Sheet1'!A1

虽然这种方法很有趣,但我建议您在网络上使用 Excel 转换率主工作簿。


报表工作簿将链接到此主汇率工作簿以获取汇率。

在发送语句之前,我会运行一些 VBA 代码来循环访问工作簿。

该代码将打开工作簿,更新链接,然后中断它。

链接单元格中保留的值是最新更新的值。

下面的代码更新并断开工作簿中的所有链接。

Sub Update_And_BreakLinks()

Dim vLinks As Variant
Dim lLinks As Long

    vLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
'Get a list of all the links in the workbook

    If IsEmpty(vLinks) Then Exit Sub
'If no links then exit

    For lLink = LBound(vLinks) To UBound(vLinks)
        ActiveWorkbook.UpdateLink Name:=vLinks(lLink), Type:=xlLinkTypeExcelLinks
    Next lLink
'Update links

    For lLink = LBound(vLinks) To UBound(vLinks)
        ActiveWorkbook.BreakLink Name:=vLinks(lLink), Type:=xlLinkTypeExcelLinks
    Next lLink
'Break the links.  The link is replaced with the value from the last update

End Sub

查看有关如何循环浏览文件夹中的工作簿的问题

5851531

One approach is to put your master conversion rates workbook on the web

Your statement workbooks can the reference master workbook on the web via formulas. For example:

='http://www.your-site.com/test/[Workbook1.xls]Sheet1'!A1

Whilst this approach is fun, I would recommend using a master Excel conversion rates workbook on your network.


The statement workbooks would link to this master conversion rates workbook to get the rates.

Before sending the statements out, I would run some VBA code to loop through the workbooks.

The code would open the workbook, update the link and then break it.

The value that would be left in the linked cells is the latest updated value.

The code below updates and breaks all links in a workbook.

Sub Update_And_BreakLinks()

Dim vLinks As Variant
Dim lLinks As Long

    vLinks = ActiveWorkbook.LinkSources(Type:=xlLinkTypeExcelLinks)
'Get a list of all the links in the workbook

    If IsEmpty(vLinks) Then Exit Sub
'If no links then exit

    For lLink = LBound(vLinks) To UBound(vLinks)
        ActiveWorkbook.UpdateLink Name:=vLinks(lLink), Type:=xlLinkTypeExcelLinks
    Next lLink
'Update links

    For lLink = LBound(vLinks) To UBound(vLinks)
        ActiveWorkbook.BreakLink Name:=vLinks(lLink), Type:=xlLinkTypeExcelLinks
    Next lLink
'Break the links.  The link is replaced with the value from the last update

End Sub

Look at this question on how to loop through workbooks in a folder

5851531

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文