Need help with sorting and moving to worksheets

M

M

I currently have an excel workbook that lists a store #, sku#, qty to
order, and a count (=countif(A:A,A2)
I have a macro working that will take all the results with a 9 in the
count column, and copy and paste them to worksheet 9.
However, what I can't get around is how to make it so that results
higher than 10 are split (ie if the result in count is 11, i want the
first 10 to be copied to tab 10, and the remainder to be copied to tab
1)
The count can be as high as 90-100, so if it were 95, it would copy 90
lines to tab 10 (9 groups of 10) plus the remaining 5 to tab 5

Thanks for your help..




store sku qty count
9 1 1 9
9 2 2 9
9 3 3 9
9 4 4 9
9 5 5 9
9 6 6 9
9 7 7 9
9 8 8 9
9 9 9 9
10 1 1 10
10 2 2 10
10 3 3 10
10 4 4 10
10 5 5 10
10 6 6 10
10 7 7 10
10 8 8 10
10 9 9 10
10 10 10 10
11 1 1 11
11 2 2 11
11 3 3 11
11 4 4 11
11 5 5 11
11 6 6 11
11 7 7 11
11 8 8 11
11 9 9 11
11 10 10 11
11 11 11 11
12 1 1 12
12 2 2 12
12 3 3 12
12 4 4 12
12 5 5 12
12 6 6 12
12 7 7 12
12 8 8 12
12 9 9 12
12 10 10 12
12 11 11 12
12 12 12 12
 
D

Donald Guillett

I currently have an excel workbook that lists a store #, sku#, qty to
order, and a count (=countif(A:A,A2)
I have a macro working that will take all the results with a 9 in the
count column, and copy and paste them to worksheet 9.
However, what I can't get around is how to make it so that results
higher than 10 are split (ie if the result in count is 11, i want the
first 10 to be copied to tab 10, and the remainder to be copied to tab
1)
The count can be as high as 90-100, so if it were 95, it would copy 90
lines to tab 10 (9 groups of 10) plus the remaining 5 to tab 5

Thanks for your help..

store sku qty  count
9       1       1       9
9       2       2       9
9       3       3       9
9       4       4       9
9       5       5       9
9       6       6       9
9       7       7       9
9       8       8       9
9       9       9       9
10      1       1       10
10      2       2       10
10      3       3       10
10      4       4       10
10      5       5       10
10      6       6       10
10      7       7       10
10      8       8       10
10      9       9       10
10      10      10      10
11      1       1       11
11      2       2       11
11      3       3       11
11      4       4       11
11      5       5       11
11      6       6       11
11      7       7       11
11      8       8       11
11      9       9       11
11      10      10      11
11      11      11      11
12      1       1       12
12      2       2       12
12      3       3       12
12      4       4       12
12      5       5       12
12      6       6       12
12      7       7       12
12      8       8       12
12      9       9       12
12      10      10      12
12      11      11      12
12      12      12      12

Should be doalbe. As ALWAYS post your existing code for comments
"If desired, send your file to dguillett1 @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top