VBA/MACRO Date Update and Print out

durwoodghib

New Member
Joined
Apr 5, 2018
Messages
4
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
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
This should get you started.

Code:
Sub DATE_PRINT()

CONST copies_to_print = [COLOR=#ff0000]'enter the number of copies here[/COLOR]
Dim begin_date As Date
Dim n As Integer

begin_date = [COLOR=#ff0000]'enter the beginning date here[/COLOR]

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
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,223,958
Messages
6,175,643
Members
452,663
Latest member
MEMEH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top