Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Worksheet Functions / March 2008

Tip: Looking for answers? Try searching our database.

Cell to match footer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
texansgal - 31 Mar 2008 16:37 GMT
Can someone please give me the formula for a cell to match what the page
header or footer says?

Thanks!
JP - 31 Mar 2008 18:51 GMT
Here's a series of short UDFs that will give you what you want. Paste
in a standard module (see http://www.rondebruin.nl/code.htm for
placement assistance).

Function GetLeftHeader()
GetLeftHeader = ActiveSheet.PageSetup.LeftHeader
End Function
Function GetCenterHeader()
GetCenterHeader = ActiveSheet.PageSetup.CenterHeader
End Function
Function GetRightHeader()
GetRightHeader = ActiveSheet.PageSetup.RightHeader
End Function
Function GetLeftFooter()
GetLeftFooter = ActiveSheet.PageSetup.LeftFooter
End Function
Function GetCenterFooter()
GetCenterFooter = ActiveSheet.PageSetup.CenterFooter
End Function
Function GetRightFooter()
GetRightFooter = ActiveSheet.PageSetup.RightFooter
End Function

To use: Just put the function name on the cell, prefixed by an equal
sign. For example, to get the left header text in cell A1:

=GetLeftHeader()

If you use this code in your PERSONAL.XLS workbook, you may have to
prefix the code like this:

=PERSONAL.XLS!GetLeftHeader()

HTH,
JP

On Mar 31, 11:37 am, texansgal <texans...@discussions.microsoft.com>
wrote:
> Can someone please give me the formula for a cell to match what the page
> header or footer says?
>
> Thanks!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.