File name in Footer without ".xls"

I

Igor

Hi,

Does anyone know how to eliminate the extension from the File Name added to
the Footer?

I want to add the File Name to the Footer but without the extension.

Thanks in advance.
 
M

muddan madhu

Go to start | my computer | tools | folder options | view tab | tick
the option hide extension for known file types | apply | ok

now go to page setup | header / footer tab | custom footer | choose
file name | ok | ok
 
R

Ron Rosenfeld

Hi,

Does anyone know how to eliminate the extension from the File Name added to
the Footer?

I want to add the File Name to the Footer but without the extension.

Thanks in advance.

You can use a Workbook Before Print event macro.

To enter the macro, <alt-F11> opens the VB Editor.

In the project that is your workbook, double click on ThisWorkbook, and paste
the code below into the window that opens.

=================================
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.PageSetup.RightFooter = Left(ThisWorkbook.Name, _
InStrRev(ThisWorkbook.Name, ".") - 1)
Next ws
End Sub
===============================
--ron
 
I

Igor

Thank you very much!

--

igor


muddan madhu said:
Go to start | my computer | tools | folder options | view tab | tick
the option hide extension for known file types | apply | ok

now go to page setup | header / footer tab | custom footer | choose
file name | ok | ok
 
I

Igor

Thanks a lot!

--

igor


Ron Rosenfeld said:
You can use a Workbook Before Print event macro.

To enter the macro, <alt-F11> opens the VB Editor.

In the project that is your workbook, double click on ThisWorkbook, and paste
the code below into the window that opens.

=================================
Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.PageSetup.RightFooter = Left(ThisWorkbook.Name, _
InStrRev(ThisWorkbook.Name, ".") - 1)
Next ws
End Sub
===============================
--ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top