View Single Post
 
Old 01-02-2018, 08:51 AM
NoSparks NoSparks is offline Windows 7 64bit Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Assuming items start in A2 with quantity in column B,
you could produce a list of all the labels needed in another column for mail merge (or something.)
Code:
Sub test_1()
    Dim rng As Range, cl As Range
    Dim i As Integer, wr As Long  '<~~ wr is write row

With Sheets("Sheet1")  '<~~ change sheet name to suit
    Set rng = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
    wr = 2  '<~~ row to start writing on
    For Each cl In rng
        For i = 1 To cl.Offset(, 1).Value * 2
            .Cells(wr, 5).Value = cl.Value  '<~~ column E is 5
            wr = wr + 1
        Next i
    Next cl
End With
End Sub
Reply With Quote