Try this

Sub Test()
Sheet1.Activate
For N = 1 To Cells(Rows.Count, 1).End(xlUp).Row
    For M = 1 To Cells(N, 2)
        Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0) = Cells(N, 1)
    Next M
Next N
End Sub
I've assumed that you data is on Sheet1 and its going onto Sheet2.