A Alice Apr 15, 2005 #1 I need to print forms from excel with auto-number generated during printing. eg 001, 002, 003 How can I do it? Thanks!
I need to print forms from excel with auto-number generated during printing. eg 001, 002, 003 How can I do it? Thanks!
D Dave Peterson Apr 15, 2005 #2 Is this a worksheet that's set up to look like a form? If yes, you could use a little macro and run that whenever you needed copies: Option Explicit Sub testme() Dim myMin As Long Dim myMax As Long Dim iCtr As Long myMin = 1 myMax = 3 For iCtr = myMin To myMax With Worksheets("sheet1") .Range("a1").Value = iCtr .PrintOut preview:=True End With Next iCtr End Sub I put the value in A1 (which was already formatted nicely, "000"). Change the myMin and myMax to what you want and get rid of the preview:=true when you're ready to kill 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
Is this a worksheet that's set up to look like a form? If yes, you could use a little macro and run that whenever you needed copies: Option Explicit Sub testme() Dim myMin As Long Dim myMax As Long Dim iCtr As Long myMin = 1 myMax = 3 For iCtr = myMin To myMax With Worksheets("sheet1") .Range("a1").Value = iCtr .PrintOut preview:=True End With Next iCtr End Sub I put the value in A1 (which was already formatted nicely, "000"). Change the myMin and myMax to what you want and get rid of the preview:=true when you're ready to kill 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