Results 1 to 4 of 4

Thread: VBA/MACRO Date Update and Print out
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Apr 2018
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA/MACRO Date Update and Print out

    Good Day,
    I have a simple weekly time sheet that currently I have to change the date each time and print, change the date, then print, until I have enough copies to last a while. I am unable to attach the file at this time, However, cell B7 would be the only date(cell) I need to change.

    What I would like to to is have a Sub Program run where I could enter the date I want to start with, how many copies I would like, and it would place the date, print a copy, add 7(days) to the date, print again, ect. until I have reach the number of copies.

    Can someone please help me get going in the right direction?

    Thanks,
    Durwood

  2. #2
    Board Regular
    Join Date
    Jun 2011
    Posts
    1,391
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA/MACRO Date Update and Print out

    This should get you started.

    Code:
    Sub DATE_PRINT()
    
    CONST copies_to_print = 'enter the number of copies here
    Dim begin_date As Date
    Dim n As Integer
    
    begin_date = 'enter the beginning date here
    
    For n = 1 To copies_to_print Step 1
    
    ThisWorkbook.Sheets("Sheet1").Range("B7").Value = begin_date
    ThisWorkbook.Sheets("Sheet1").PrintOut COPIES:=1
    
    begin_date = begin_date + 7
    Next
    
    End Sub
    Excel 2010, Windows 10

  3. #3
    New Member
    Join Date
    Apr 2018
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA/MACRO Date Update and Print out

    I want to thank you for the response. I have not had much time to try this as of yet. Hope to soon.

  4. #4
    New Member
    Join Date
    Apr 2018
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA/MACRO Date Update and Print out

    Good Day,

    So work has been crazy and this has been a back burner job. However, today I utilized the code given and it worked beautifully. Thank you YKY for the help.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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