Results 1 to 6 of 6

Print with macro Excel w/ sequence number

Threaded View

  1. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,645

    Re: Print with macro Excel w/ sequence number

    Hi there,

    Here's a cheap 'n' cheerful approach which might get you moving in the right direction.

    Take a look at the attached workbook and see if it does what you need. It uses the following code:

    
    
    Option Explicit
    
    
    Sub PrintLabels()
    
        Const sSHEET_NAME   As String = "Labels"
        Const sLABEL_NO     As String = "ptrLabelNo"
    
        Dim iNoOfLabels     As Integer
        Dim iLabelNo        As Integer
        Dim rLabelNo        As Range
        Dim wks             As Worksheet
    
        Set wks = ThisWorkbook.Worksheets(sSHEET_NAME)
        Set rLabelNo = wks.Range(sLABEL_NO)
    
        iNoOfLabels = wks.Range("ptrNoOfLabels")
    
        For iLabelNo = 1 To iNoOfLabels
    
            rLabelNo.Value = iLabelNo
    
    '       The "Preview" argument is set to True for demonstration purposes -
    '       you can change its value to False to bypass the print preview step
            wks.PrintOut Preview:=True
    
        Next iLabelNo
    
        rLabelNo.Value = 1
    
    End Sub
    The above code assumes that each label is printed on a single sheet. If you're using (e.g. 3 x 6) label sheets, the above code and the layout of the "Labels" worksheet will need to be altered accordingly. Let me know if you need any assistance with that.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro for Number Sequence
    By Rj13 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2019, 05:55 AM
  2. Macro to find and print gaps in a number sequence
    By jheidens in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2018, 09:15 AM
  3. need to print a sequence of numbers on excel 2013
    By eltyar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-21-2016, 02:32 PM
  4. Replies: 7
    Last Post: 06-08-2015, 08:39 AM
  5. Macro sequence number
    By onenessboy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2012, 02:46 PM
  6. Excel 2007 : print number sequence on 2 part ncr paper
    By quinterod in forum Excel General
    Replies: 1
    Last Post: 03-31-2011, 10:35 AM
  7. Replies: 1
    Last Post: 07-29-2005, 08:05 PM

Tags for this Thread

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