Solved

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

Posted on 2013-11-20
2
496 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 200 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

751 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