Footer Question

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
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?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

tmischler

Well-known Member
Joined
Jun 17, 2004
Messages
669
whoops - been an idiot and just found the "file and path" option - apologies, please delete this thread and save me further embarrassment!
 

Forum statistics

Threads
1,147,621
Messages
5,742,184
Members
423,710
Latest member
Duarte85

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top