#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Loop

Just to make a point... it took 1 hour 6 minutes for you to get an answer to
your question and another 34 minutes after that for you to see that answer.
You could have gotten an instaneous answer to your question if you had
placed your cursor on the word FindNext in your code and pressed F1 to evoke
Help for it... the Help file that would have come up for this method
explains the problem you raised in its Remarks section and gives a code
example on how to get around the problem.

Rick


"ranswert" wrote in message
...
Thanks I'll give that a try

"Jim Rech" wrote:

Will this get in a continual loop


Looks like it. What you want to do with the Find method is stop when
you're
back to the first hit, since Excel will just keep finding the same cells.
So get the address of the first hit and then break out of the loop if a =
linkno or the address of xcell = the address of the first hit.

--
Jim
"ranswert" wrote in message
...
| Will this get in a continual loop if "a" never equals "linkno"?
|
| With rng
| Set xcell = .find(what:=drwno, LookIn:=xlValues,
| LookAt:=xlWhole, _
| SearchOrder:=xlByColumns)
| a = xcell.Offset(0, 10).Value
| MsgBox ("a = " & a)
| If a < linkno Then
| Do
| Set xcell = .FindNext(xcell)
| a = xcell.Offset(0, 10).Value
| Loop While a < linkno
| End If
| End With
| Thanks




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop to Filter, Name Sheets. If Blank, Exit Loop ryguy7272 Excel Programming 3 February 5th 08 03:41 PM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 5 March 29th 07 05:48 AM
Naming Worksheets - Loop within a loop issue klysell Excel Programming 0 March 27th 07 11:17 PM
Advancing outer Loop Based on criteria of inner loop ExcelMonkey Excel Programming 1 August 15th 05 05:23 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM


All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"