ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto consecutive numbering (https://www.excelbanter.com/excel-discussion-misc-queries/160718-auto-consecutive-numbering.html)

abchildress

Auto consecutive numbering
 
I am printing the same form multiple times, and I want each copy to have a
different number. How do I make this happen??


I need cell D1 to update every time I print or enter, I don't care which, I
need for it to read W6090 print then W6091 print,,,,,


I have no idea how to write or make code work. Just not that advanced. I
have seen the code but really dont have a clue how to make it work. I have
gone in and pasted to the VB editor but??????

Any help at all would be wonderful!!!

Thanks
Annette


jhyatt

Auto consecutive numbering
 
try this link
http://www.mcgimpsey.com/excel/udfs/sequentialnums.html

"abchildress" wrote:

I am printing the same form multiple times, and I want each copy to have a
different number. How do I make this happen??


I need cell D1 to update every time I print or enter, I don't care which, I
need for it to read W6090 print then W6091 print,,,,,


I have no idea how to write or make code work. Just not that advanced. I
have seen the code but really dont have a clue how to make it work. I have
gone in and pasted to the VB editor but??????

Any help at all would be wonderful!!!

Thanks
Annette


Gord Dibben

Auto consecutive numbering
 
This revised code from Ron de Bruin will enter a consecutive number in D1 of
each copy you print.

Only question I have is about the W6090. What do you want to see if you print
more than 10 copies?

W6100 then W6101 etc. That would take more code

Sub PrintCopies_ActiveSheet_1()
Dim CopiesCount As Long
Dim CopieNumber As Long
CopiesCount = Application.InputBox("How many copies do you want", Type:=1)

For CopieNumber = 0 To CopiesCount
With ActiveSheet
.Range("D1").Value = "W609" & CopieNumber & " print"
.PrintOut preview:=True
' add an apostrophe to line above and remove from line below to print.
' .PrintOut
End With
Next CopieNumber
End Sub

For more on this see Ron's site at http://www.rondebruin.nl/print.htm#same

Since you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo.


Gord Dibben MS Excel MVP


On Wed, 3 Oct 2007 11:35:01 -0700, abchildress
wrote:

I am printing the same form multiple times, and I want each copy to have a
different number. How do I make this happen??


I need cell D1 to update every time I print or enter, I don't care which, I
need for it to read W6090 print then W6091 print,,,,,


I have no idea how to write or make code work. Just not that advanced. I
have seen the code but really don’t have a clue how to make it work. I have
gone in and pasted to the VB editor but??????

Any help at all would be wonderful!!!

Thanks
Annette




All times are GMT +1. The time now is 02:07 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com