Hi there,
I currently have the following macro to add footers onto worksheets:
Sub footer()
Dim ws As Worksheet
For Each ws In Worksheets
With ws.PageSetup
.LeftFooter = "&F"
.CenterFooter = "&A"
.RightFooter = "&D"
End With
Next ws
End Sub
What I want to do though is swap the file name for the file path. The only way I can think of to do this is to select a cell that will very rarely be used eg.a65500 and set the footer equal to:
Range("A65500").FormulaR1C1 = "=CELL(""FILENAME"")"
However, I am aware that this is not very efficient in terms of the size of the resulting workbook. Does anyone know a better way?
I currently have the following macro to add footers onto worksheets:
Sub footer()
Dim ws As Worksheet
For Each ws In Worksheets
With ws.PageSetup
.LeftFooter = "&F"
.CenterFooter = "&A"
.RightFooter = "&D"
End With
Next ws
End Sub
What I want to do though is swap the file name for the file path. The only way I can think of to do this is to select a cell that will very rarely be used eg.a65500 and set the footer equal to:
Range("A65500").FormulaR1C1 = "=CELL(""FILENAME"")"
However, I am aware that this is not very efficient in terms of the size of the resulting workbook. Does anyone know a better way?