LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 386
Default Automatically incrementing number for each print

Sorry for jumping in but I think I am trying to d something similar.

I have 4 tables within one sheet in one excel file which i need to print 50
times to get a total of 200 copies. I would like each table to have a
unique reference number 1,2,3,4. The cells I need to fill are S6, AS6, S59
and AS59, which will have numbers 1-4 on the first sheet printed, (one number
per
table that is), 5-9 on the second etc.

Is it possible to adapt the solution u proposed here to do that? I am
completely clueless on VBA.

Thanks

"Bernie Deitrick" wrote:

You could use the before print event to increment a value:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 1
End Sub

Note that this will only work if you print only one sheet at a time - printing multiple copies only
fires this event once.

Otherwise, you could use a macro to print multiple copies:

Sub PrintEm()
Dim i As Integer
For i = 1 to 100
Worksheets("Sheet1").Range("A1").Value = Worksheets("Sheet1").Range("A1").Value + 1
Worksheets("Sheet1").PrintOut
Next i
End Sub

HTH,
Bernie
MS Excel MVP


"Nefermet" wrote in message
...
I'm trying to create a jobsheet that will automatically increment the
jobsheet number each time it is printed. Is this possible?




 
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
I WANT TO SET PRINT RANGE TO NUMBER OF COLUMNS ckbusia Setting up and Configuration of Excel 2 January 20th 05 07:47 PM
Can excel automatically number itself each time you open a documen Alesha Excel Discussion (Misc queries) 1 January 11th 05 07:40 PM
how do I put a a sequence number into colun A automatically witho. Custodio Bernardes Excel Discussion (Misc queries) 2 January 2nd 05 11:30 PM
How do I automatically pull a new invoice number into an excel te. Hube Excel Discussion (Misc queries) 3 December 28th 04 11:27 PM
Can Excel add a set percentage to a cell automatically when you type in a number Chris B. Excel Worksheet Functions 3 October 29th 04 07:08 PM


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