FileName in Foote

Notadumbblonde

Board Regular
Joined
Nov 18, 2003
Messages
104
Hey Simple but tough question everyone!

I have this bit of code that writes the full file name with Path.

activesheet.pagesetup.rightfooter= activeworkbook.fullname

Is there anyway I can just pull the filename without the path?

thanks
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Public Sub NoPath()
MsgBox ActiveWorkbook.Name
End Sub


in other words ....

activesheet.pagesetup.rightfooter= activeworkbook.name
 
Upvote 0
Public Sub NoPath()
MsgBox Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)
End Sub


IN other words ...

ActiveSheet.PageSetup.RightFooter = Left(ActiveWorkbook.Name, Len(ActiveWorkbook.Name) - 4)
 
Upvote 0

Forum statistics

Threads
1,225,585
Messages
6,185,825
Members
453,330
Latest member
NAtyNat29

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
Back
Top