Solved

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

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

809 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