Thread: Missing Numbers
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Colo[_45_] Colo[_45_] is offline
external usenet poster
 
Posts: 1
Default Missing Numbers

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/