Because I do not have enough reputation to post comments/ask questions in threads other than mine, I started this new thread. Pls let me know if I could still have posted my questions in the original thread, thnx.
I also want to acknowledge that posters in the thread referenced are very superior and I hold them in high esteem - my questions or comments here are for the purpose of learning and better understanding and not for the disrespect of anybody, thnx.
My first questions to the OP, @Clemens -
1) In your posting you say - "So, I'm using a For Each loop to iterate trough the 1st (src) column, and the CountIf method to check if the item is already present in the 2nd (des) column. If not, copy to the end of the 1st (src) column
." In your posted code you actually copy to the end of the 2nd (des) column
, not the 1st (src) column
, don't you? -tmpLastRow = wsDes.Cells(Rows.Count, 1).End(xlUp).Row + 1 ' first empty row on target sheet
wsDes.Cells(tmpLastRow, 1) = wsSrc.Cells(x.Row, 9)
2) You responded to @Sidd@SiddharthRout for his fast fix brought your runtime down to 2secs and yet after that you accepted the answer from @It's been a pleasure (or mehow). Did mehow's approach actually address your issue? I tried his code, not with his attached random data, but with my data of one srcCol of 6261 company names to populate an empty desCol with just unique company names from the srcCol - which I believe is similar to what you were trying to do with your 7000 rows, isn't it? Well first of all, his code doesn't pick up data uniquely from one Col to the other. With my data, it just copies "values only" from all rows from the srcCol to the desCol in under 1 sec! However, with some simple modifications, his code does after all copy unique "values only" (sans bold and interior color from the src) and therefore becomes somewhat useful - takes 30 secs for my 6161 company names which could very well be due to my inexperience :)
Now I am going to try Sid's, Reafidy's and some other methods and post back.
Aucun commentaire:
Enregistrer un commentaire