All:
I have created an excel "Workorder" form for our employees to write in what
machine they are working on, what parts they used, and how long they spent
on the repair...
The problem... I need to print out hundreds of these forms for the men to
use, and each copy of the form needs to have an unique number.
Is there a way to program a cell to automatically increment by 1 every time
it is printed? Again, I need to print hundres at a time, and I need them
to automatically increment by 1.
TIA,
Lance
Dave Peterson - 08 Mar 2005 21:48 GMT
Set up your worksheet the way you want (print layout). Then use a macro to
print it.
Option Explicit
Sub testme()
Dim myCell As Range
Dim iCtr As Long
Dim HowMany As Long
HowMany = 5
With Worksheets("sheet1")
Set myCell = .Range("a1")
If IsNumeric(myCell.Value) Then
'keep going
Else
MsgBox "Please put a nice starting number in A1!"
Exit Sub
End If
For iCtr = 1 To HowMany
myCell.Value = myCell.Value + 1
.PrintOut preview:=True
Next iCtr
End With
End Sub
I used 5 and "preview:=true" to save some trees.
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
> All:
>
[quoted text clipped - 11 lines]
> TIA,
> Lance

Signature
Dave Peterson