Hi everyone
Here's a table (with nonsensical data) that represents a spreadsheet. "Data 1" = A1 as you'd expect.
What I'm looking for, is how to copy the row (A and B only) where the value of C in that row = "N", change "N" to "Y" (preventing it from being copied again the next time the code runs) and paste the values to another sheet. Pasting to the next blank row on another sheet is something I already have a solution to using:
However, its the conditional copy function immediately before "ThisWorkbook.Sheets" I'm having trouble with - not even sure where to begin, never mind getting it to check repeatedly.
As you can see, there may be multiple uncopied rows so the code needs to carry on looking for a match with "N" after it has found and copy/pasted the first one - C5 in this example
I should also point out that there will be many blank rows after C8 (in this example) - so a function where it only checks Column C from "C2" to the first blank cell in C would probably be much quicker than checking the entirety of the column - but again, that's way beyond my skills.
Thanks for any help
Here's a table (with nonsensical data) that represents a spreadsheet. "Data 1" = A1 as you'd expect.
What I'm looking for, is how to copy the row (A and B only) where the value of C in that row = "N", change "N" to "Y" (preventing it from being copied again the next time the code runs) and paste the values to another sheet. Pasting to the next blank row on another sheet is something I already have a solution to using:
VBA Code:
ThisWorkbook.Sheets("aSheetCalledGerald").Range("B" & Rows.Count).End(xlUp).Offset(1, 0)
However, its the conditional copy function immediately before "ThisWorkbook.Sheets" I'm having trouble with - not even sure where to begin, never mind getting it to check repeatedly.
As you can see, there may be multiple uncopied rows so the code needs to carry on looking for a match with "N" after it has found and copy/pasted the first one - C5 in this example
Data 1 | Data 2 | Copied Y/N |
Steve | Turkey | Y |
John | Pirate | Y |
Apple | 515 | Y |
Cricket | Violin | N |
HDMI | Baseball | N |
Sofa | Script | N |
Moon | Badger | N |
I should also point out that there will be many blank rows after C8 (in this example) - so a function where it only checks Column C from "C2" to the first blank cell in C would probably be much quicker than checking the entirety of the column - but again, that's way beyond my skills.
Thanks for any help