print spreadsheet with each coming day dated on it for 2006.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a spreadsheet in excell that I want to print with todays date on it as
a header and then some how be able to print one for each day for the rest of
the year. I dont want to have to print it each day, or make a copy of it and
change the date everyday. I want to be able to print the whole thing today
with just this one copy that I have in excell. Please help.
 
Try this one

Enter the first day in A1 before you run the macro
If it is working correct change PrintPreview to PrintOut

This example will not print the sunday's

Sub PrintCopies_ActiveSheet()
Dim yr As Integer
yr = Year(Range("a1").Value)
Do While Year(Range("a1").Value) = yr
If Application.WorksheetFunction. _
Weekday(Range("a1").Value) <> 1 Then
ActiveSheet.PrintPreview
End If
Range("a1").Value = Range("a1").Value + 1
Loop
End Sub
 
If I understand your request then in your header type the following...
&[DATE]

Good Luck!!
 
Crystal my problem is that will this let me print the same spreadsheet
multiple times with a different date on it each time with only this one
command I need 1print for each day of the year?

Crystal said:
If I understand your message correctly then in your header use....
&[DATE]

Good Luck!

Megan said:
I have a spreadsheet in excell that I want to print with todays date on it as
a header and then some how be able to print one for each day for the rest of
the year. I dont want to have to print it each day, or make a copy of it and
change the date everyday. I want to be able to print the whole thing today
with just this one copy that I have in excell. Please help.
 
Hi Megan

Insert the first date in A1 first


Alt-F11
Insert>Module from the menubar
paste the sub in there
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "PrintCopies_ActiveSheet" and press Run
 
whats the sub?

Ron de Bruin said:
Hi Megan

Insert the first date in A1 first


Alt-F11
Insert>Module from the menubar
paste the sub in there
Alt-Q to go back to Excel

If you do Alt-F8 you get a list of your macro's
Select "PrintCopies_ActiveSheet" and press Run
 
I'm actually in the same office as Megan, trying to help her w/ this.

What do you mean by "paste the sub in there". I've got everything else
figured out, except this.
 
Sub (subroutine) is the macro

Sub PrintCopies_ActiveSheet()
Dim yr As Integer
yr = Year(Range("a1").Value)
Do While Year(Range("a1").Value) = yr
If Application.WorksheetFunction. _
Weekday(Range("a1").Value) <> 1 Then
ActiveSheet.PrintPreview
End If
Range("a1").Value = Range("a1").Value + 1
Loop
End Sub
 
Ok I see now where I have each date if I go throught the print preview option
but when I print it only prints the currnet page I am on.
 
sorry for being a pane but another question is why wont it print sundays and
can it be set to because we nned this print out for SUndays also.
 
Hi Megan

I think you have set your print area
If you want to print all data on the sheet then go to File>Print Area...Clear Print Area

Or do you want to print the whole workbook ?
 
Hi Megan
sorry for being a pane but another question is why wont it print sundays and
can it be set to because we nned this print out for SUndays also.

The example Iposted not print the sundays but if you want them also then use this macro

..Sub PrintCopies_ActiveSheet()
Dim yr As Integer
yr = Year(Range("a1").Value)
Do While Year(Range("a1").Value) = yr
ActiveSheet.PrintPreview
Range("a1").Value = Range("a1").Value + 1
Loop
End Sub
 
I did do that I figured it was an oops but I still cant get it to print the
entire workbook up to December 31st 2006 with just one stroke of the print
key. Any ideas, I can page through them in the print preview option but I
dont want to have to individually print each one. Thanks for all of your help.
 
Ok

Then use this one

I use a sheet named "Sheet1"
In this sheet enter the first date in A1

Test it with a start date of 29-Dec or so

Sub PrintCopies_Activeworkbook()
Dim yr As Integer
With Sheets("sheet1")
yr = Year(.Range("a1").Value)
Do While Year(.Range("a1").Value) = yr
ActiveWorkbook.PrintOut
.Range("a1").Value = .Range("a1").Value + 1
Loop
End With
End Sub
 
Ok the test page it did worked wonderfully I am goping to try my report I
will let you know how it works, thank you for all your help.
 
Back
Top