Bonediggler
Technical User
Hi--
I wrote some code the logic of which should do the following:
1) Loops through a column of values (inner loop)
2) Looks for 4 specific values
3) When it finds any of these 4 values, copies the entire row it is in
4) Pastes this row to another worksheet in the same workbook
5) Go back and complete the inner loop
6) When the inner loop is done, move to the next worksheet (specified via an outer loop) and do the same thing over again
I also wrote an error handler that does the following:
1) If, during the inner loop, the first specified value is not available, look for the second value. If the second value is not available, look for the third value and so on. If the fourth value is not available, go to the outer loop (next worksheet).
The problem is that the error handler works for the first instance of the inner loop (i.e. for the first worksheet), but does not work after that--it throws 'run time error 91 Object Variable or With Block variable not set'...the error that is generated when it cannot find a value...which of course it was designed to handle.
Thanks in advance for your help.
I wrote some code the logic of which should do the following:
1) Loops through a column of values (inner loop)
2) Looks for 4 specific values
3) When it finds any of these 4 values, copies the entire row it is in
4) Pastes this row to another worksheet in the same workbook
5) Go back and complete the inner loop
6) When the inner loop is done, move to the next worksheet (specified via an outer loop) and do the same thing over again
I also wrote an error handler that does the following:
1) If, during the inner loop, the first specified value is not available, look for the second value. If the second value is not available, look for the third value and so on. If the fourth value is not available, go to the outer loop (next worksheet).
The problem is that the error handler works for the first instance of the inner loop (i.e. for the first worksheet), but does not work after that--it throws 'run time error 91 Object Variable or With Block variable not set'...the error that is generated when it cannot find a value...which of course it was designed to handle.
Thanks in advance for your help.