![]() |
|
#2
|
|||
|
|||
|
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
|
| Tags |
| adding multiple rows, mail merge, vba |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Extracting multiple words from one cell into individual rows while copying all other data | randyaserve | Excel Programming | 4 | 10-05-2015 09:52 AM |
| Hide rows in multiple columns based on zero values | Deane | Excel Programming | 19 | 06-23-2015 11:24 PM |
Insert values from multiple rows based on value in one column
|
pachmarhi | Excel | 3 | 07-18-2014 09:57 PM |
Creating formula based on if data is correct in cell
|
MattMurdock | Excel | 1 | 08-06-2012 03:11 AM |
Hide Rows and Update Chart based on cell value
|
ubns | Excel Programming | 5 | 05-07-2012 05:44 AM |