Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Spreadsheets (https://www.askmehelpdesk.com/forumdisplay.php?f=395)
-   -   Serial Number Label (https://www.askmehelpdesk.com/showthread.php?t=230952)

  • Jun 26, 2008, 06:29 AM
    wintel
    Serial Number Label
    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:
  • Jun 26, 2008, 06:42 AM
    ScottGem
    Set a formula to reference the previous cell and add one to it.
  • Jun 26, 2008, 11:17 AM
    JBeaucaire
    Let me fiddle around a little and see if I can get that to work... nice idea!
  • Jun 26, 2008, 11:21 AM
    ScottGem
    Note: Please do not use e-mails or PMS for follow-up. All follow-up should be posted to this thread.
  • Jun 27, 2008, 07:29 AM
    JBeaucaire
    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:
    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ą!
  • Jun 27, 2008, 03:11 PM
    JBeaucaire
    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.
    Code:

    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


  • All times are GMT -7. The time now is 11:58 AM.