4

I have many worksheets and at present, every 3 months I have to go through these one by one to update information in just a few cells.

It would be great if I could create a master source file containing these few cells that get updated, that all my worksheets linked to, so that I could just update this file and all my files would then update.

The only trouble I have is that I then send these worksheets out to clients by email, each client gets a specific worksheet.

This would mean that the local links to the master source file would no longer be there and I'm assuming there would be errors. Is there some way that I could link my files, as desired, to a master file, be able to update the master file and have all the other files update accordingly, but then send only a single file to a client and keep the values from the master file.

I hope this is making sense! It's quite simple what I want to do, it's just a bit tricky putting it into words.

Any help or advice would be great!

4

2 回答 2

3

您会认为有一种开箱即用的简单方法可以做到这一点,但它确实存在问题。这个不太优雅的解决方案展示了如何从更新客户表时必须打开的主工作簿复制单元格或范围。显然,客户端用户不会拥有主工作簿,因此在这种情况下宏会静默失败。将此代码放在每个客户端工作簿的 ThisWorkbook 模块中。

Private Sub Workbook_Open()
    On Error Resume Next
    Dim master As Workbook
    Set master = Workbooks("master.xlsm")

    If master Is Nothing Then
    'the client is probably opening the wbook. do nothing
    Else 'copy your stuff here
        With Workbooks("master.xlsm")
            .Worksheets("Sheet1").Range("A1:D4").Copy _
                Destination:=Worksheets("Sheet1").Range("A1:D4")
        End With
    End If

End Sub
于 2011-05-18T16:51:19.433 回答
0

我希望我正确理解了您的问题。我们所做的是将工作簿保存为具有不同文件名的不同工作簿。我们通常将“_sent.xlsx”附加到工作簿文件名。然后打开它,转到数据,编辑链接,然后断开所有链接。只有“价值观”会保留在工作簿中。保存工作簿,您可以将其发送出去,而不必担心打开它时会破坏的值。如果您需要更改任何内容,您仍然拥有原始文件。

于 2012-01-20T11:27:43.430 回答