View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] LRogers81@gmail.com[_2_] is offline
external usenet poster
 
Posts: 7
Default Do Loop doesn't stop

Hi, I have a problem with a Do Until loop, it doesn't stop unless I
Ctrl Break out of it, here's the loop:

Dim productRow As String
Dim foundRowNum As Integer
Dim i As Integer

productRow = InputBox("Enter the product code")
i = 4
Do Until i = 131
If Range("A" & i).Value = productRow Then
foundRowNum = i
MsgBox "The row for product " & productRow & " is " &
foundRowNum & ".", _
vbInformation
Exit Do
End If
Loop

Am I missing something here or is it ok? I want the user to be able
to input the product number and the msgbox to display the product
number and it's corresponding row...is my syntax off somewhere, are my
dimensions wrong? I'm clueless...please advise...thanks...

-Lee