Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default Increment Date Based on Number of Pages Printed

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   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Increment Date Based on Number of Pages Printed

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   Report Post  
Posted to microsoft.public.excel.misc
Billy
 
Posts: n/a
Default Increment Date Based on Number of Pages Printed

Thanks! Will give it a shot.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
How to determine the number of units based on given condition? Eric Excel Worksheet Functions 3 March 6th 06 09:22 AM
How can I number pages so it changes every 3 pages? tina Excel Discussion (Misc queries) 0 February 16th 06 12:28 AM
Creating a certain number of entries based on a number in a cell PPV Excel Worksheet Functions 4 June 16th 05 10:25 PM
Use Julian Date To Create Serial Number antho10359 Excel Discussion (Misc queries) 4 December 9th 04 01:50 AM


All times are GMT +1. The time now is 11:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"