+ Reply to Thread
Results 1 to 4 of 4

Add date when printing

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Add date when printing

    Hi,

    I have created a macro that modifies my excelsheet and prints it out fittet to one page.

    I am using this code to print:

    Sub Print()
    '
    ' Print Macro
    
    '
    ActiveWindow.SelectedSheets.PrintOut Copies:=5, Collate:=True
    End Sub
    I am trying to modify the code so the todays date (or the date that it is printed) appears on the center-top with letter size 16 on the print.


    The sheet holds values from cell A1 and therefore I believe a TODAYS() formula in ex cell A1 is not an option....?

    Hope someone can assist me

    Gnoke
    Last edited by gnoke; 11-09-2010 at 10:32 AM.

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

    Re: Add date when printing

    Why not add it to the Header or Footer, you don't need VBA?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    07-21-2010
    Location
    Alta, Norway
    MS-Off Ver
    Excel 2003
    Posts
    119

    Re: Add date when printing

    but of course, my stupidity:p

    thanks both of you

  4. #4
    Forum Contributor
    Join Date
    04-16-2009
    Location
    Dorset, UK
    MS-Off Ver
    Office 2003, Office 2007
    Posts
    131

    Re: Add date when printing

    Either add a header to each sheet of &[Date] or in code use this to add the header to each sheet you are printing:
        Dim S As Object
        
        For Each S In ActiveWindow.SelectedSheets
            S.PageSetup.CenterHeader = "&D"
        Next

+ 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