lynyrdskynyrd5
New Member
- Joined
- May 22, 2017
- Messages
- 8
Code:
Sub DupeRows()
Dim cell As Range
'First cell with number of tickets
Set cell = Range("B2")
Do While Not IsEmpty(cell)
If cell > 1 Then
Range(cell.Offset(1, 0), cell.Offset(cell.Value - 1, 0)).EntireRow.Insert
Range(cell, cell.Offset(cell.Value - 1, 1)).EntireRow.FillDown
End If
Set cell = cell.Offset(cell.Value, 0)
Loop
End Sub
I am now on page 334-Excel 2016 Power Programming with VBA (Mr. Spreadsheet's Bookshelf) - Michael Alexander. I cannot just move further on the next page of the book as I am sure I will encounter the same cell.offset argument ahead.