+ Reply to Thread
Results 1 to 10 of 10

Page Header/Footer - Take info from cell

  1. #1
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Page Header/Footer - Take info from cell

    Any help please

    I want to create a header/footer for a sheet taken from the info in a particular cell.

    Its straight forward enough to create it from filename/tab name etc but cant see how I can take it from a cell

    Any thoughts

    Thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Page Header/Footer - Take info from cell

    There is no built-in way to do this. It requires a macro. Here is code that will set the center footer of whatever sheet is active to the contents of cell A1 on that sheet. This can also be enhanced to update it automatically any time that the contents of A1 changes.

    Please Login or Register  to view this content.
    Edit: Removed unnecessary With/End With although it would have worked fine
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Re: Page Header/Footer - Take info from cell

    That's worked a treat, thank you

    Can it be formatted in a preset style, IE bold, particular font, font size etc, or is that asking too much?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Page Header/Footer - Take info from cell

    It can be set to do all those things; there are special codes that can be inserted into the footer text to make it bold, font, size, etc. However, I don't know of a reference that lists them all. What I do, even though I'm fairly experienced with VBA, is to record a macro to set up the footer then look at the generated code to see what it did. Do be wary of macro bloat.

  5. #5
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Re: Page Header/Footer - Take info from cell

    The macro is set up to add the Footer from a cell but I would then have to go in and manually change the font/size/bold etc...can these be set in the same macro, the one you suggested?

  6. #6
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Re: Page Header/Footer - Take info from cell

    Sorry, read your reply again...you're suggesting I record a macro, changing the Footers appearance to what I want, then copying the result into the original macro???

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Page Header/Footer - Take info from cell

    Almost. I'm suggesting you record a macro, changing the footer's appearance to what you want, then study the resulting macro to learn how it works, then modify the macro I provided. For example, this modifies my macro to use Algerian font, bold, 14-point size.


    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Re: Page Header/Footer - Take info from cell

    OK, would this embed the font I choose or would someone see a different font if I chose something unusual?

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,792

    Re: Page Header/Footer - Take info from cell

    The font code is just a text string that refers to that font by name. If that font is not loaded on the machine, then Excel or Windows will decide how to display it. I do not know how it handles that, possibly uses a default.

  10. #10
    Registered User
    Join Date
    07-02-2008
    Location
    Hebburn
    Posts
    17

    Re: Page Header/Footer - Take info from cell

    Thanks very much for the help Jeff

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Why does header and footer info change when I email?
    By XcelIdiot in forum Excel General
    Replies: 0
    Last Post: 08-09-2012, 03:59 PM
  2. Replies: 5
    Last Post: 03-19-2012, 06:14 PM
  3. Header on first, footer on last page?
    By alexa2 in forum Excel General
    Replies: 2
    Last Post: 03-12-2009, 05:36 PM
  4. header/footer from page
    By BorisS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-13-2005, 08:00 AM
  5. How do I get the same header/footer to print on each page of a wo.
    By Stephen Connolly in forum Excel General
    Replies: 2
    Last Post: 03-17-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1