I am trying to do a conditional for loop with Excel with 2 separate sheets.
In the first sheet I have a list of names, sex, and occupation. I am trying to pull the whole row/range out if the particular occupation is an “auditor” to a specific range in the next sheet.
But the process keeps returning the last value: “Jerry”. Where instead I want to have “James”, “Jacob”, “Joseph”, and “Jerry” as they all are “auditor”.
I have ensure to tick the append box, and still having my data overwritten instead.
@prasath17 Amazing. This is exactly what I wanted to achieve. But do you know why my original solution does not work when I try to force a specific range using write range instead of using counter. As in why does it keep over-writing the data.
@Dennon_Seet - To be honest, I have tried various approach including If condition with Write Range and Append Range using Current Index…all the approach has been failed…
My Understanding is: Since we are giving the range as hardcoded value, say j4: L4 if you think logically…everytime the current row gets in it will read j4 to L4 and try to append the data in J5 to L5…that’s why we were getting only last line output…
If the data is in table or datatable or sheet this will work perfectly…