View Full Version : Serial Number Label
wintel
Jun 26, 2008, 06:29 AM
I am trying to create a Serial Number program in Excel. I have the template designed and it is a 1 page document. I would like to type in the starting serial number and click File - Print and change the quantity to the number of serial numbers that I need. As each page prints I need the serial number on each page to increase by 1. Kind of like the Page number increasing as each page prints. Is this possible?:confused:
ScottGem
Jun 26, 2008, 06:42 AM
Set a formula to reference the previous cell and add one to it.
JBeaucaire
Jun 26, 2008, 11:17 AM
Let me fiddle around a little and see if I can get that to work... nice idea!
ScottGem
Jun 26, 2008, 11:21 AM
Note: Please do not use e-mails or PMS for follow-up. All follow-up should be posted to this thread.
JBeaucaire
Jun 27, 2008, 07:29 AM
I think the only way to do it is with a macro.
TOOLS > MACRO > MACROS
Enter a new macro title PRINTNUMBERS, then click CREATE
The macro window will appear, paste in this code:
Sub PRINTNUMBERS()
For n = 1 To 30
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("A1").Value = Range("A1").Value + 1
Next n
End Sub
This macro assumes your serial number is in cell A1. Adjust that to the correct cell.
This macro will print 30 serial numbers. Edit the macro to adjust for the number you want to print out.
Voilą!
JBeaucaire
Jun 27, 2008, 03:11 PM
Here is the best solution. Running this macro ASKS you how many serial numbers you need. Then it prints the sheet, increasing the serial number by 1 each time.
Again, just update the cell reference A1 to match your correct serial number cell. Oh, and be sure to save the document each time.
Sub test()
a = Application.InputBox("Enter No. :", , , , , , , 1)
If a <= 1 Then
MsgBox "Must be more than 1"
Exit Sub
End If
For n = 1 To a
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Range("A1").Value = Range("A1").Value + 1
Next n
End Sub