+ Reply to Thread
Results 1 to 4 of 4

Footer Program

  1. #1
    Registered User
    Join Date
    07-26-2006
    Posts
    5

    Footer Program

    Hi
    So I am int he middle of writing a program in VBA Macro that would loop through all the Excel files in a directory and change the footer. HOwever the code that I have now

    .LeftFooter = "&[Date]"
    .CenterFooter = "&[Path]&[File]"
    .RightFooter = "&[Page]of &[Pages]"

    VB i percieving this code (the code that appears in the View Header/Footer Window) As a string.. so its putting the word date on the left hand of the footer. Any Suggestions?

  2. #2
    Les
    Guest

    RE: Footer Program

    Try using the following formatting codes instead.

    &D Prints the current date.
    &Z Prints the path.
    &F Prints the name of the document.
    &P Prints the page number.
    &N Prints the total number of pages in the document.

    i.e.

    > .LeftFooter = "&D"
    > .CenterFooter = "&Z&F"
    > .RightFooter = "&P of &N"



    --
    Les Torchia-Wells


    "bs272" wrote:

    >
    > Hi
    > So I am int he middle of writing a program in VBA Macro that would loop
    > through all the Excel files in a directory and change the footer.
    > HOwever the code that I have now
    >
    > .LeftFooter = "&[Date]"
    > .CenterFooter = "&[Path]&[File]"
    > .RightFooter = "&[Page]of &[Pages]"
    >
    > VB i percieving this code (the code that appears in the View
    > Header/Footer Window) As a string.. so its putting the word date on the
    > left hand of the footer. Any Suggestions?
    >
    >
    > --
    > bs272
    > ------------------------------------------------------------------------
    > bs272's Profile: http://www.excelforum.com/member.php...o&userid=36812
    > View this thread: http://www.excelforum.com/showthread...hreadid=566144
    >
    >


  3. #3
    Tom Ogilvy
    Guest

    RE: Footer Program

    just to add, the easiest is to turn on the macro recorder and set up your
    footers onetime manually. then turn off the macro recorder and look at the
    code.

    This would have showed you the codes Les is talking about.

    Also, if you did any richtext formatting or event changing fonts and size
    (as examples) this would be an expecially useful approach.

    --
    Regards,
    Tom Ogilvy



    "Les" wrote:

    > Try using the following formatting codes instead.
    >
    > &D Prints the current date.
    > &Z Prints the path.
    > &F Prints the name of the document.
    > &P Prints the page number.
    > &N Prints the total number of pages in the document.
    >
    > i.e.
    >
    > > .LeftFooter = "&D"
    > > .CenterFooter = "&Z&F"
    > > .RightFooter = "&P of &N"

    >
    >
    > --
    > Les Torchia-Wells
    >
    >
    > "bs272" wrote:
    >
    > >
    > > Hi
    > > So I am int he middle of writing a program in VBA Macro that would loop
    > > through all the Excel files in a directory and change the footer.
    > > HOwever the code that I have now
    > >
    > > .LeftFooter = "&[Date]"
    > > .CenterFooter = "&[Path]&[File]"
    > > .RightFooter = "&[Page]of &[Pages]"
    > >
    > > VB i percieving this code (the code that appears in the View
    > > Header/Footer Window) As a string.. so its putting the word date on the
    > > left hand of the footer. Any Suggestions?
    > >
    > >
    > > --
    > > bs272
    > > ------------------------------------------------------------------------
    > > bs272's Profile: http://www.excelforum.com/member.php...o&userid=36812
    > > View this thread: http://www.excelforum.com/showthread...hreadid=566144
    > >
    > >


  4. #4
    Tom Ogilvy
    Guest

    RE: Footer Program

    Let me try again

    For the original poster,
    just to add, the easiest is to turn on the macro recorder and set up your
    footers one time manually. then turn off the macro recorder and look at the
    code.

    This would have showed you the codes Les is talking about.

    Also, if you did any richtext formatting or even changing fonts and size
    (as examples) this would be an expecially useful approach.

    --
    Regards,
    Tom Ogilvy



    "Tom Ogilvy" wrote:

    > just to add, the easiest is to turn on the macro recorder and set up your
    > footers onetime manually. then turn off the macro recorder and look at the
    > code.
    >
    > This would have showed you the codes Les is talking about.
    >
    > Also, if you did any richtext formatting or event changing fonts and size
    > (as examples) this would be an expecially useful approach.
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    >
    > "Les" wrote:
    >
    > > Try using the following formatting codes instead.
    > >
    > > &D Prints the current date.
    > > &Z Prints the path.
    > > &F Prints the name of the document.
    > > &P Prints the page number.
    > > &N Prints the total number of pages in the document.
    > >
    > > i.e.
    > >
    > > > .LeftFooter = "&D"
    > > > .CenterFooter = "&Z&F"
    > > > .RightFooter = "&P of &N"

    > >
    > >
    > > --
    > > Les Torchia-Wells
    > >
    > >
    > > "bs272" wrote:
    > >
    > > >
    > > > Hi
    > > > So I am int he middle of writing a program in VBA Macro that would loop
    > > > through all the Excel files in a directory and change the footer.
    > > > HOwever the code that I have now
    > > >
    > > > .LeftFooter = "&[Date]"
    > > > .CenterFooter = "&[Path]&[File]"
    > > > .RightFooter = "&[Page]of &[Pages]"
    > > >
    > > > VB i percieving this code (the code that appears in the View
    > > > Header/Footer Window) As a string.. so its putting the word date on the
    > > > left hand of the footer. Any Suggestions?
    > > >
    > > >
    > > > --
    > > > bs272
    > > > ------------------------------------------------------------------------
    > > > bs272's Profile: http://www.excelforum.com/member.php...o&userid=36812
    > > > View this thread: http://www.excelforum.com/showthread...hreadid=566144
    > > >
    > > >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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