LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 106
Default Auto increment & print three copies

Hi Folks,

I have a little macro that will prompt a user for the number of copies they
want of the given sheet (only one in the workbook), then print three copies
of it (for three-part carbonless paper) then increment to the next number
(the sheet has a numberical value and print another three copies. The
problem I have is each time I'm done running the macro I have to go back into
the code and manually update the incrementing number.

What I would like to do is have the macro look to a particular cell to know
what number to start with and increment.

Here is what I'm currently working with...

' Copy Count (as of last run) = 270001
Sub PrintCopies_ActiveSheet()
Dim CopiesCount As Long
Dim CopyNumber As Long
CopiesCount = Application.InputBox("How many copies do you want???",
Type:=1)

For CopyNumber = 1 To CopiesCount
With ActiveSheet
'number in cell I1
.Range("I1").Value = 270001 + CopyNumber

'Print the sheet
.PrintOut copies:="1"

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 4
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

.PrintOut copies:="1"

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 4
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

.PrintOut copies:="1"

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 4
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime

End With
Next CopyNumber
End Sub

TIA,

Steve!
 
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
Number of copies to print keep defaulting to 12 copies why? Boski Excel Worksheet Functions 1 October 8th 09 05:33 PM
auto increment Trizzle Excel Discussion (Misc queries) 1 December 6th 06 09:14 PM
ask for one print and it gives 6 copies raybag Excel Discussion (Misc queries) 0 October 17th 06 03:03 AM
DP Auto increment [email protected] Excel Worksheet Functions 2 August 16th 06 12:37 AM
How do I auto increment cell value on print in Excel Hiren Excel Worksheet Functions 7 January 25th 05 06:39 PM


All times are GMT +1. The time now is 12:46 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"