My current loop is this:
I would prefer to not have to define the loop, ie 7 iterations, and instead have it test for a condition.
After the first iteration, I want the loop to go to the left one column and down two rows from the last active cell, and if this cell contains the value "x" stop the loop, if it doesn't, then the activecell needs to get back to where it left off before testing for "x", ie one column to the right and two rows up, and then move on to the next iteration of the loop and continue testing until it finds x.
Code:
Let x = 0
Do While x < 7
Selection.End(xlDown).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Resize(Selection.Rows.Count, Selection.Columns.Count + 8).Select
Selection.ClearContents
Selection.End(xlDown).Select
x = x + 1
Loop
I would prefer to not have to define the loop, ie 7 iterations, and instead have it test for a condition.
After the first iteration, I want the loop to go to the left one column and down two rows from the last active cell, and if this cell contains the value "x" stop the loop, if it doesn't, then the activecell needs to get back to where it left off before testing for "x", ie one column to the right and two rows up, and then move on to the next iteration of the loop and continue testing until it finds x.
Last edited by a moderator: