?
Solved

how to edit the print footer in excel 2010 to refer a range name

Posted on 2013-11-20
2
Medium Priority
?
510 Views
Last Modified: 2013-11-21
In the custom footer, left section, I put the range name there [ModelVersion], but it didn't work.  Any idea?
0
Comment
Question by:jjxia2001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Expert Comment

by:NBVC
ID: 39664024
You need to do it through a macro.

Here is a Microsoft support article on the subject:

http://support.microsoft.com/kb/273028
0
 
LVL 12

Accepted Solution

by:
Harry Lee earned 800 total points
ID: 39664059
jjxia2001,

Excel Header and Footer does not support formula. Which means you cannot simply type in =A10 or =B1 as the header.

One way to do it is to use a vba WorkBook event, BeforePrint. The VBA code has to be under the ThisWorkbook.

To get to the ThisWorkbook VBA code, press Alt-F11 to open up VBA Editor. Then press Ctrl-R to open up the Project Explorer.

On the left, in the Project Explorer, look for the group with the filename of the file you are working on. Under there, you should see some sheets names, and a ThisWorkbook.

Double click to open it, and paste in the following code to test.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim WS As Worksheet
For Each WS In Worksheets
    WS.PageSetup.LeftFooter = ThisWorkbook.FullName & " " & Worksheets("Sheet1").Range("A2").Value
Next WS
End Sub

Open in new window


This code would set the Left Page Foot to the Name of the Sheet + the value in Sheet1 Cell A2.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
New style of hardware planning for Microsoft Exchange server.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question