Hi all. I'm a beginner so I guess this is a beginner question However...
I have made a Macro for a sales rapport, as I want to merge some number from the article list into the sales list. I would be in great help for some feedback.
To begin with, I have one sheet which is a sales reports file with 50000 rows, and I have one sheet with is an article list on 500 rows. The common denominator is the SKU. (Every sales order row has a SKU and every article list row has a SKU.)
Now I would like to add some article info (whether it is a central warehouse product or not) into the sales sheet in order to make stats. Thus, I made a new column in the sales sheet and made a macro.
Basically what the macro does is to loop through all sales 50000 rows, and for each row it checkes for a SKU-match in the article row (loops up to 500 until match). If the CWP-kolumn is 1 in the article sheet, I set the new CWP-column in the sales sheet to 1 as well. If not, I set it to 0. (And if we get no SKU-match at all, it should be 2.)
I have two questions:
1. In this solution, I can only run 5000 lines at a time. Is there a setting to that I could run all the rows in one click? I understnad it's up to 50000x500 rows to go through, but could I make the process to run in a slower pace or something in order not to hang up.
2. Is there a better way of doing this?
Thanks in advance
Slightly simplified, this is my code:
Please Login or Register to view this content.
Bookmarks