Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Incrementing the date

I'm trying to print a daily register, with the date on the top, is it
possible to increment the date for every day of the month to save having to
change the date 30 odd times? I would like to print them off all in one go
without having to change the date several times.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Incrementing the date

You wish to print 30 copies in one print job with the date changing in each
copy?

Here is a revised version of code from Ron de Bruin's site

Sub PrintCopies_ActiveSheet_1()
Dim CopiesCount As Long
Dim CopieNumber As Long
Dim startdate As Date

CopiesCount = Application.InputBox("How many copies do you want", Type:=1)
startdate = InputBox("enter a starting date")

For CopieNumber = 1 To CopiesCount
With ActiveSheet
' This example print the number in cell A1
'.Range("A1").Value = Format(startdate - 1 + _
CopieNumber, "dddd mmmm dd ,yyyy")
'If you want the number in the header use this line
.PageSetup.CenterHeader = Format(startdate - 1 + _
CopieNumber, "dddd mmmm dd ,yyyy")
'Print the sheet
.PrintOut preview:=True 'for testing
' .PrintOut 'for printing
End With
Next CopieNumber
End Sub

No error-checking.

For original code from Ron see http://www.rondebruin.nl/print.htm#same


Gord Dibben MS Excel MVP

On Mon, 29 Oct 2007 09:11:03 -0700, mills08
wrote:

I'm trying to print a daily register, with the date on the top, is it
possible to increment the date for every day of the month to save having to
change the date 30 odd times? I would like to print them off all in one go
without having to change the date several times.


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
incrementing paul/bones[_2_] Excel Worksheet Functions 2 September 12th 07 01:54 PM
incrementing luuthur Excel Discussion (Misc queries) 4 May 23rd 07 05:07 AM
incrementing a date that the user has entered? pano Excel Worksheet Functions 4 January 23rd 07 03:22 AM
Incrementing numbers Floyd107 Excel Worksheet Functions 2 February 28th 06 10:04 AM
Incrementing by 1 when doc is opened Jenner Excel Worksheet Functions 3 February 16th 06 01:58 AM


All times are GMT +1. The time now is 01:57 PM.

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

About Us

"It's about Microsoft Excel"