+ Reply to Thread
Results 1 to 7 of 7

Placing Date in footer

  1. #1
    Registered User
    Join Date
    06-28-2007
    Posts
    7

    Placing Date in footer

    I have the date in the footer of a page which is expressed as "& [Date]" which gives me a simple date. But I want the date to be formatted to show Day, Date, Time such as:

    Friday, September 14, 2007 8:32 PM

    I think I can do this via some VBA formatting code, but I don't know how - can anyone help?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This will add the date & time

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-28-2007
    Posts
    7

    Still struggling

    I guess I don't know how to enter your code correctly. It appears to have no effect.

    Let me ask the question in a different way -

    I have a cell in the spreadsheet that uses the function Now(). That cell has a custom format of dddd m/d/yyyy h:mm AM/PM. This causes the cell to display :

    Sunday 9/16/2007 8:44 AM

    Is there anyway that I can get the content and format of this cell into the footer? I want to show the day of the week as well as the date and time.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,641
    Hi there Mike,

    Enter the following code in the "ThisWorkbook" VBA module of your workbook:

    Please Login or Register  to view this content.
    This will put the required information & format in the centre footer of each worksheet in your workbook.

    Hope this helps - please let me know how you get on.

    Best regards,

    Greg M

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    This code will place the contents of A1 into the Footer. You could use the Before_Print event

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-28-2007
    Posts
    7

    Footer still does not appear

    Hi guys. Thanks for thehelp but I guess there's something that I'm missing. It still does not work, even though it looks to me like it should. Attached is a test sheet that should show what I've done. What am I doing wrong?
    Attached Files Attached Files

  7. #7
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Code needs to go in thisworkbook (See link)

    http://www.contextures.com/xlvba01.html#Workbook

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ 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