Printing dates

B

bpreilly

how can i print consecutive dates on multiple copies of the same worksheet?
"monday may 1st" tuesday may 2nd" and so on
 
D

Dave Peterson

You could provide a dedicated macro that adjusts the dates and does the
printing.

Option Explicit
Sub testme()
Dim StartDate As Date
Dim HowMany As Long
Dim dCtr As Long

StartDate = DateSerial(2008, 9, 25)
HowMany = 12

With Worksheets("sheet1")
For dCtr = StartDate To (StartDate + HowMany)
With .Range("A1")
.NumberFormat = "dddd mmmm dd, yyyy"
.Value = dCtr
.EntireColumn.AutoFit
End With
.PrintOut preview:=True
Next dCtr
End With

End Sub

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top