Mackeral
Board Regular
- Joined
- Mar 7, 2015
- Messages
- 249
- Office Version
- 365
- Platform
- Windows
The Example Code:[CODE]
Row = 1 LastRow = {some number}
Rng = "A" & Row ":" & "A" & LastRow
Do While Find_String(Rng,"Look for Something",Ans_Row) Then
______...
______Row = Row + 1
______Rng = "A" & Row ":" & "A" & LastRow
Loop[/CODE]
I have just found that the FIND command goes past the last row and uses a range like <code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">"A5:A4"</code> the Find operator does NOT return a FALSE anymore. It use to until quite recently.
The test to exit the loop you have to add tthis test inside the loop.
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">If Row > LastRow Then Exit Do</code>
Row = 1 LastRow = {some number}
Rng = "A" & Row ":" & "A" & LastRow
Do While Find_String(Rng,"Look for Something",Ans_Row) Then
______...
______Row = Row + 1
______Rng = "A" & Row ":" & "A" & LastRow
Loop[/CODE]
I have just found that the FIND command goes past the last row and uses a range like <code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">"A5:A4"</code> the Find operator does NOT return a FALSE anymore. It use to until quite recently.
The test to exit the loop you have to add tthis test inside the loop.
<code style="margin: 0px; padding: 1px 5px; border: 0px; font-style: inherit; font-variant: inherit; font-weight: inherit; font-stretch: inherit; line-height: inherit; font-family: Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, sans-serif; font-size: 13px; vertical-align: baseline; box-sizing: inherit; background-color: rgb(239, 240, 241); white-space: pre-wrap;">If Row > LastRow Then Exit Do</code>
Last edited: