+ Reply to Thread
Results 1 to 8 of 8

Print incremental dates in a cell on each new sheet printed

  1. #1
    Registered User
    Join Date
    04-17-2015
    Location
    Arizona
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Print incremental dates in a cell on each new sheet printed

    I created a print button to ask for the date, then change the value of 2 cells and print, this works well. Now I want to ask for the number of worksheets to print and then add 7 days to the date for each new worksheet.


    Private Sub Workbook_BeforePrint(Cancel As Boolean)
    If ActiveSheet.Name = "Sheet1" Then
    Range("B1", "D1").Value = InputBox("Enter Date")
    End If
    End Sub

  2. #2
    Valued Forum Contributor
    Join Date
    11-12-2014
    Location
    Nottingham
    MS-Off Ver
    2013
    Posts
    383

    Re: Print incremental dates in a cell on each new sheet printed

    Put this code into yours and it should do the trick
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-17-2015
    Location
    Arizona
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Print incremental dates in a cell on each new sheet printed

    This is what I have coded, I get runtime error!
    Please Login or Register  to view this content.
    Is There something missing or wrong?
    I want "D1" to receive the date and also then change "D1" for the next worksheet.
    Last edited by wooster16; 04-17-2015 at 07:07 PM. Reason: code

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Print incremental dates in a cell on each new sheet printed

    MAybe:

    Range("D1").Value = CDate(InputBox("Enter Date"))
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  5. #5
    Registered User
    Join Date
    04-17-2015
    Location
    Arizona
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Print incremental dates in a cell on each new sheet printed

    Still receive error after entering

    Please Login or Register  to view this content.

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Print incremental dates in a cell on each new sheet printed

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-17-2015
    Location
    Arizona
    MS-Off Ver
    MS Office 2013
    Posts
    4

    Re: Print incremental dates in a cell on each new sheet printed

    Thank You! This code works to advance the date ahead the 3 sheets I asked for, but it only prints one sheet with the very last date that it advanced to. How do I get it to print the other sheets as well?

    I'm using a print button with this code entered:
    Please Login or Register  to view this content.
    and then this code added before print

    Please Login or Register  to view this content.

  8. #8
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Print incremental dates in a cell on each new sheet printed

    Try:

    Please Login or Register  to view this content.

+ 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. print incremental numbers per page per worksheet
    By swiftrain in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-23-2013, 03:48 PM
  2. print sheet number (increasing) for each copy printed
    By randell.graybill in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-22-2009, 10:40 PM
  3. Reference a cell from an another sheet which is incremental
    By pad5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-25-2008, 11:08 AM
  4. How do I code a footer to print variable cell data on each printed page?
    By DeannaT in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-04-2008, 12:14 PM
  5. [SOLVED] Cell value displays in Print Preview but truncates when printed
    By MaryC in forum Excel General
    Replies: 2
    Last Post: 07-06-2005, 08:05 PM

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