Results 1 to 2 of 2

Print reference range of serial numbers into specified cell

Threaded View

  1. #1
    Registered User
    Join Date
    12-09-2013
    Location
    Singapore
    MS-Off Ver
    10
    Posts
    2

    Print reference range of serial numbers into specified cell

    hello people,

    i'm currently figuring out a macro that prints 199 pages of the same worksheet, a template for a cover page of a vehicle maintenance record and i need the 199 pages to be printed with a different ID defined in a column of 199 cells, each with a unique number not in a sequential arrangement(i.e. 1001, 1002, 1003, ... x+1, x+1+1, ...etc)

    Instead what I need to do is have the printed pages print from a series of data in a column as such:
    1) 123
    2) 369
    3) 246
    4) 135
    5) 999
    ...
    10) ###
    etc and so forth till 199).
    I've seen increments of +1 done fairly simply but i do not know how to adjust the macro to pring from a list of numbers.

    I've done several google searches but I only found this as the nearest match to whhat I need.

     Sub Print2000() 
    Dim i 
    setRng = InputBox("Enter the starting number...", "First Number")
     If setRng = "" Then 
    Exit Sub 
    ElseIf Not IsNumeric(setRng) Then 
    MsgBox "Entry must be numeric!", vbCritical, "Invalid Entry" 
    Exit Sub 
    End 
    If dblChk = MsgBox("Are you sure you wish to print 2000 pages?", _
    vbYesNo, "Think Twice - Act Once!") 
    Select Case 
    dblChk Case Is = 
    vbYes Range("A1").Value = "" 
    Range("A1").NumberFormat = "@" 
    For i = 1 To 2000 
    If setRng < 10 
    Then pfx = "000" 
    ElseIf setRng < 100 Then 
    pfx = "00" 
    ElseIf setRng < 1000Then 
    pfx = "0" 
    Else pfx = "" 
    End If 
    Range("A1").Value =pfx & setRng 
    ActiveSheet.PrintOut 
    setRng = setRng + 1 
    Next 
    Case Is = vbNo 
    End Select 
    End Sub
    This macro was for printing 2000 pages with a number set entered into cell A1.

    This is my first time using VBA macros and I'm very unsure of the terms defined in macro.

    I think this might be an easy one for me to learn, i hope someone could guide me on what to do.

    Moderator Note:

    Pls use code tags around your code next time as per forum rules.
    Last edited by arkaether; 12-09-2013 at 04:31 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto serial numbers across multiple work sheet in a workbook in a particular cell
    By subhassamuel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-19-2013, 05:43 AM
  2. Print Serial Numbers In Excel Spreadsheet
    By dizjackson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-14-2013, 09:24 AM
  3. Print a variable range based on cell reference
    By aondrusek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2012, 09:27 PM
  4. Macro to define a range of serial numbers in Excel
    By Quohawk in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-11-2010, 01:19 PM
  5. Finding a serial number in a list of serial numbers
    By zocoloco in forum Excel General
    Replies: 2
    Last Post: 02-04-2009, 05:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1