Hi Soniya, here is a simple LOOP code.
Code:
--------------------
Sub Test()
Dim i As Long, j As Long
i = 1
For Each c In Range([A2], [A65536].End(xlUp))
If c.Offset(1).Value = "" Then Exit For
j = c.Value
Do Until j = c.Offset(1).Value - 1
j = j + 1: i = i + 1
Cells(i, 2).Value = j
Loop
Next
End Sub
--------------------
---
Message posted from
http://www.ExcelForum.com/