arsovat,
Select 1 column by however many rows you have (for your example, 3 rows: the cells with 12, 24, and
36), then run the macro below.
HTH,
Bernie
MS Excel MVP
Sub TryNow()
Dim myRow As Long
Dim myR As Range
Dim myC As Range
Dim i As Long
Set myR = Selection
If myR.Columns.Count > 1 Then Exit Sub
With Application
..EnableEvents = False
..ScreenUpdating = False
End With
For myRow = myR.Cells(myR.Rows.Count).Row To _
myR.Cells(1).Row Step -1
For i = Cells(myRow, myR.Column).Value + 1 To _
Cells(myRow, myR.Column + 1).Value
Cells(myRow, myR.Column).EntireRow.Copy
Cells(myRow, myR.Column).Insert
Next i
Set myC = Cells(myRow, myR.Column).Resize(Cells(myRow, _
myR.Column + 1) - Cells(myRow, myR.Column).Value + 1)
myC.Formula = "=" & Cells(myRow, myR.Column).Value & _
" + ROW()-ROW(" & Cells(myRow, myR.Column).Address & ")"
myC.Copy
myC.PasteSpecial xlPasteValues
Next myRow
myR.Offset(0, 1).EntireColumn.Delete
myR.Cells(1).Select
With Application
..EnableEvents = True
..ScreenUpdating = True
End With
End Sub