I have an Excel VBA program that loops through each row of data in a data sheet.
My goal is to exit the while loop once boolean bFound
is set as True
.
I think my condition "Or bFound=True" might be incorrect.
bFound = False
While Sheets("Data").Cells(iRow, 1) <> "" Or bFound = True
If Sheets("Data").Cells(iRow, 11) = Sheets("Data2").Cells(iRow, 1) Then
bFound = True
End If
iRow = iRow + 1
Wend
'exit loop after the boolean=true