The "Data" array is a two dimensional array. The column number indices for Data are 1 and 2, and not the same column numbers as on the worksheet e.g. 15 and 16.
Also, put this in a standard code module e.g. Module1 and not the worksheet's code module.
Sub Repeat_Data()
Dim Data
Dim i As Long, NextRow As Long
Data = Range("O1", Range("P" & Rows.count).End(xlUp)).Value
NextRow = 2
Application.ScreenUpdating = False
For i = 1 To UBound(Data, 1)
Cells(NextRow, "J").Resize(Data(i, 1)).Value = Data(i, 2)
NextRow = NextRow + Data(i, 1)
Next i
Application.ScreenUpdating = True
End Sub
Bookmarks