I want to run a loop until Excel cant find anymore cells that match the value i declared. What statement must i use to along with false in order to accomplish this. thanx in advance.
Off the top of my head I don't think Excel Find has anything like Word's .Find.Wrap property and it will loop forever round your worksheet if you let it. What you have to do is note the address of the first cell you find your search string in and compare the rest against it until you get there again which means there are no more.
find = Worksheets(1).Cells(n, 1).Value
Do While n < 65500
find = Worksheets(1).Cells(n, 1).Value
If find ="123" Then
MsgBox "Found"
endif
n = n + 1
Loop
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.