Hi Andrew,
Just wanting to clarify on your requirements - so you have multiple workbooks, one is the master. In this master you essentially have a 'header' that is to appear in all child workbooks, and any changes to this header (including formatting, sizing etc) will be reflected in all of the 'child' workbooks? You have tried using formulas pointing to the master workbook, but any changes to the formatting in the master workbook is not appearing in the cells with the formula (as the formula is merely linking to the contents of the cell).
If the above is correct then the only way I can think to do it would be:
- Use VBA code in the master document to update all child documents with the header
- Use VBA code in each child document to update the header from the master documents (my preference)
Here's some code that I put together that would do option 2 for you. You could even automate the macro to run each time the document is opened so that it updates the header automatically without the user even knowing. To test this code out create a file master.xlsx and in the first three rows add some formatting (change column widths, font size, colour etc) and save. Paste the below code into another macro enabled workbook and change the code to point to the correct place where your master.xlsx file is. Once this is done, running the macro should import your header into the first three rows of the child workbook.
Sub ImportHeader()
Dim MainWorkbook As Workbook
Dim OtherWorkbook As Workbook
With Application
.ScreenUpdating = False
.DisplayAlerts = False
End With
'sets the child workbook as the main workbook
Set MainWorkbook = ThisWorkbook
'opens the master with the header
Workbooks.Open Filename:="E:\Master.xlsx", ReadOnly:=True
'sets the currently open file as the other workbook
Set OtherWorkbook = ActiveWorkbook
'activates the main sheet in newly opened workbook. replace with name of your sheet
Sheets("Main").Activate
'copies header range
Range("A1:ZZ3").Copy
'activates original workbook
MainWorkbook.Activate
'selects start of header range
Range("A1").Select
'pastes header from master workbook
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
'closes master workbook
OtherWorkbook.Close
End Sub
Bookmarks