Hi there,
here is the code:
Option Explicit
Sub DuplicateTickets()
Dim sht As Worksheet
Dim Xrow, NewRows As Integer
Set sht = Sheets("Sheet1")
Xrow = 1
Do Until sht.Cells(Xrow, 1) = ""
If sht.Cells(Xrow, 5) > 1 Then
NewRows = sht.Cells(Xrow, 5) - 1
sht.Cells(Xrow + 1, 1).Resize(NewRows, 1).EntireRow.Insert
sht.Cells(Xrow, 1).Resize(1, 4).Copy
sht.Cells(Xrow + 1, 1).Resize(NewRows, 4).PasteSpecial Paste:=xlPasteAll
Application.CutCopyMode = False
sht.Cells(Xrow, 5).Resize(NewRows + 1, 1) = 1
Xrow = Xrow + NewRows
End If
Xrow = Xrow + 1
Loop
End Sub
And Your file:
Untitled 1.xls
Hope it helps
Bookmarks