Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now