View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Steff_DK[_20_] Steff_DK[_20_] is offline
external usenet poster
 
Posts: 1
Default Available serial numbers...

Not the most elegant way, but here's how I fixed it:

Dim iSer As Integer
Dim iSertwo As Integer
Dim FoundCell As Range
iSer = 1000
iSertwo = 1000
Set FoundCell = Range("A1")

Do Until FoundCell Is Nothing
iSer = iSertwo
iSertwo = iSer + 1

Range("case").Select
Set FoundCell = Range("case").Find(What:=iSertwo, After:=ActiveCell
LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
_
MatchCase:=False)
Loop
End With
Msgbox iSertw

--
Message posted from http://www.ExcelForum.com