Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a full-page form that we use in paper form. It is date
dependent and instead of having to manually enter in the date in a cell at the top of the form for each day, then click print, I would love to get it to just do it for me. Is there a way to make it so that if I print 30 pages it will give me a different date for each page? Thanks in advance! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
You want to print out a month's supply of the form?
You could use a little macro: Option Explicit Sub testme() Dim myDateCell As Range Dim iCtr As Long Dim wks As Worksheet Set wks = Worksheets("Sheet1") With wks Set myDateCell = .Range("a1") For iCtr = 0 To 30 myDateCell.Value = myDateCell.Value + iCtr .PrintOut preview:=True Next iCtr End With End Sub You could even put the first date in the cell and have it go to the end of that month and skip the weekends: Option Explicit Sub testme2() Dim myDateCell As Range Dim myDate As Date Dim iCtr As Long Dim wks As Worksheet Set wks = Worksheets("Sheet1") With wks Set myDateCell = .Range("a1") myDate = myDateCell.Value For iCtr = myDate To DateSerial(Year(myDate), Month(myDate) + 1, 0) If Weekday(iCtr, vbMonday) 5 Then 'weekend, do nothing Else myDateCell.Value = iCtr .PrintOut preview:=True End If Next iCtr End With End Sub I did use Preview:=true for testing. If you're new to macros, you may want to read David McRitchie's intro at: http://www.mvps.org/dmcritchie/excel/getstarted.htm wrote: I have a full-page form that we use in paper form. It is date dependent and instead of having to manually enter in the date in a cell at the top of the form for each day, then click print, I would love to get it to just do it for me. Is there a way to make it so that if I print 30 pages it will give me a different date for each page? Thanks in advance! -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks! Will give it a shot.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I create a schedule from a list of dates ? | Charts and Charting in Excel | |||
How to determine the number of units based on given condition? | Excel Worksheet Functions | |||
How can I number pages so it changes every 3 pages? | Excel Discussion (Misc queries) | |||
Creating a certain number of entries based on a number in a cell | Excel Worksheet Functions | |||
Use Julian Date To Create Serial Number | Excel Discussion (Misc queries) |