Loop through searches in Excel
AnsweredHi,
can someone tell me what I am missing. I normally use this set of actions with no fail, but that might have been just luck, cause now I keep getting errors with this specific combination.
Let me try to explain what I want to do.
I want to find all cells with a certain combination of text in it, and then I want to investigate each cell one by one until I find the "right" one.
What I am doing.
Search all cells in a range called A1:AA5000 - search for text containing "hs" - Matching cell count will be saved to a variable, starting at the first cell in the range.
Then i will "select" cell "A1"
Next, I am looping the amount of times that the variable shows
Inside the loop, the first action will search "forward" for the cell with the text containing "hs" again, this time by starting at the "active cell".
In my particular case, I have two cell containing "hs" - meaning I will loop twice. The cells are "F41+G26"
First loop... no problem, it will find the cell F41... next loop. the active cell is F41, and it will again search "forward" from the active cell, but here I will get an error instead of it to find cell G26!? What am I missing?? :o/
Thank you in advance
Ghita
-
Hi Ghita,
this looks like a bug, unfortunately. I did some testing and here is what I discovered:
It fails in very specific cases, when the next search item is "above" the previous one. So this one will fail:
But this one will work fine:
I will report this to NIntex and meanwhile you can use this approach: you should search column by column and exit the loop when the search result is false and when it reached the last column.
We apologize for the inconvenience, let as know if we can provide more assistance.
Please sign in to leave a comment.
Comments
4 comments