Hello all,
I need help with a problem which I'm trying to implement using VBA code but unfortunately due to lack of practice and knowledge about coding I'm not able to get the desired output.
The problem is given below:
1) A macro which can open a workbook and copy the data within the columns "B","D","G","N" and "Q" along with the column headers and paste those in a new(Blank) workbook.
2) Then the macro will open another workbook (similar to the previous one) and copy the same columns as mentioned in step 1 but without the column headers and paste it in the first empty cell below the data pasted as part of step 1.
Request anyone with the solution to this problem to please help me out.
A sample reference sheet with some data has been attached:
I need help with a problem which I'm trying to implement using VBA code but unfortunately due to lack of practice and knowledge about coding I'm not able to get the desired output.
The problem is given below:
1) A macro which can open a workbook and copy the data within the columns "B","D","G","N" and "Q" along with the column headers and paste those in a new(Blank) workbook.
2) Then the macro will open another workbook (similar to the previous one) and copy the same columns as mentioned in step 1 but without the column headers and paste it in the first empty cell below the data pasted as part of step 1.
Request anyone with the solution to this problem to please help me out.
A sample reference sheet with some data has been attached:
ir211wk12sample.xls | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | |||
1 | Sr No. | OrderDate | Region | Rep | Item | Units | Unit Cost | Total | Bins | Frequency | Intervals | Item Type | Frequency | Rel. Freq | % Freq. | Intervals | Intervals | ||
2 | 1 | 9-1-14 | Central | Smith | Desk | 2 | 125.00 | 250.00 | 9 | 6 | 0-9 | Pencil | 13 | 0.302325581 | 30.2% | 0-9 | 0-9 | ||
3 | 2 | 6-17-15 | Central | Kivell | Desk | 5 | 125.00 | 625.00 | 19 | 4 | Oct-19 | Binder | 15 | 0.348837209 | 34.9% | Oct-19 | Oct-19 | ||
4 | 3 | 9-10-15 | Central | Gill | Pencil | 7 | 1.29 | 9.03 | 29 | 4 | 20-29 | Pen | 5 | 0.11627907 | 11.6% | 20-29 | 20-29 | ||
5 | 4 | 11-17-15 | Central | Jardine | Binder | 11 | 4.99 | 54.89 | 39 | 3 | 30-39 | Pen Set | 7 | 0.162790698 | 16.3% | 30-39 | 30-39 | ||
6 | 5 | 10-31-15 | Central | Andrews | Pencil | 14 | 1.29 | 18.06 | 49 | 2 | 40-49 | Desk | 3 | 0.069767442 | 7.0% | 40-49 | 40-49 | ||
7 | 6 | 2-26-14 | Central | Gill | Pen | 27 | 19.99 | 539.73 | 59 | 6 | 50-59 | 43 | 1 | 100.0% | 50-59 | 50-59 | |||
8 | 7 | 10-5-14 | Central | Morgan | Binder | 28 | 8.99 | 251.72 | 69 | 6 | 60-69 | 60-69 | 60-69 | ||||||
9 | 8 | 12-21-15 | Central | Andrews | Binder | 28 | 4.99 | 139.72 | 79 | 3 | 70-79 | 70-79 | 70-79 | ||||||
10 | 9 | 2-9-14 | Central | Jardine | Pencil | 36 | 4.99 | 179.64 | 89 | 3 | 80-89 | Oct-19 | 80-89 | 80-89 | |||||
11 | 10 | 8-7-15 | Central | Kivell | Pen Set | 42 | 23.95 | 1,005.90 | 99 | 6 | 90-99 | 90-99 | 90-99 | ||||||
12 | 11 | 1-15-15 | Central | Gill | Binder | 46 | 8.99 | 413.54 | 0 | 100+ | 100+ | 100+ | |||||||
13 | 12 | 1-23-14 | Central | Kivell | Binder | 50 | 19.99 | 999.50 | 9 | 6 | 0-9 | Pencil | 13 | 0.302325581 | 30.2% | 0-9 | 0-9 | ||
14 | 13 | 3-24-15 | Central | Jardine | Pen Set | 50 | 4.99 | 249.50 | 19 | 4 | Oct-19 | Binder | 15 | 0.348837209 | 34.9% | Oct-19 | Oct-19 | ||
15 | 14 | 5-14-15 | Central | Gill | Pencil | 53 | 1.29 | 68.37 | 29 | 4 | 20-29 | Pen | 5 | 0.11627907 | 11.6% | 20-29 | 20-29 | ||
16 | 15 | 7-21-15 | Central | Morgan | Pen Set | 55 | 12.49 | 686.95 | 39 | 3 | 30-39 | Pen Set | 7 | 0.162790698 | 16.3% | 30-39 | 30-39 | ||
17 | 16 | 4-10-15 | Central | Andrews | Pencil | 66 | 1.99 | 131.34 | 49 | 2 | 40-49 | Desk | 3 | 0.069767442 | 7.0% | 40-49 | 40-49 | ||
18 | 17 | 12-12-14 | Central | Smith | Pencil | 67 | 1.29 | 86.43 | 59 | 6 | 50-59 | 43 | 1 | 100.0% | 50-59 | 50-59 | |||
19 | 18 | 4-18-14 | Central | Andrews | Pencil | 75 | 1.99 | 149.25 | 69 | 6 | 60-69 | 60-69 | 60-69 | ||||||
20 | 19 | 5-31-15 | Central | Gill | Binder | 80 | 8.99 | 719.20 | 79 | 3 | 70-79 | 70-79 | 70-79 | ||||||
21 | 20 | 2-1-15 | Central | Smith | Binder | 87 | 15.00 | 1,305.00 | 89 | 3 | 80-89 | Oct-19 | 80-89 | 80-89 | |||||
22 | 21 | 5-5-14 | Central | Jardine | Pencil | 90 | 4.99 | 449.10 | 99 | 6 | 90-99 | 90-99 | 90-99 | ||||||
23 | 22 | 6-25-14 | Central | Morgan | Pencil | 90 | 4.99 | 449.10 | 0 | 100+ | 100+ | 100+ | |||||||
24 | 23 | 12-4-15 | Central | Jardine | Binder | 94 | 19.99 | 1,879.06 | 6 | 0-9 | Pencil | 13 | 0.302325581 | 30.2% | 0-9 | 0-9 | |||
25 | 24 | 11-25-14 | Central | Kivell | Pen Set | 96 | 4.99 | 479.04 | 4 | Oct-19 | Binder | 15 | 0.348837209 | 34.9% | Oct-19 | Oct-19 | |||
26 | 25 | 2-18-15 | East | Jones | Binder | 4 | 4.99 | 19.96 | 4 | 20-29 | Pen | 5 | 0.11627907 | 11.6% | 20-29 | 20-29 | |||
27 | 26 | 11-8-14 | East | Parent | Pen | 15 | 19.99 | 299.85 | 3 | 30-39 | Pen Set | 7 | 0.162790698 | 16.3% | 30-39 | 30-39 | |||
28 | 27 | 9-18-14 | East | Jones | Pen Set | 16 | 15.99 | 255.84 | 2 | 40-49 | Desk | 3 | 0.069767442 | 7.0% | 40-49 | 40-49 | |||
29 | 28 | 7-12-14 | East | Howard | Binder | 29 | 1.99 | 57.71 | 6 | 50-59 | 43 | 1 | 100.0% | 50-59 | 50-59 | ||||
30 | 29 | 8-15-14 | East | Jones | Pencil | 35 | 4.99 | 174.65 | 6 | 60-69 | 60-69 | 60-69 | |||||||
31 | 30 | 4-1-14 | East | Jones | Binder | 60 | 4.99 | 299.40 | 3 | 70-79 | 70-79 | 70-79 | |||||||
32 | 31 | 6-8-14 | East | Jones | Binder | 60 | 8.99 | 539.40 | 3 | 80-89 | Oct-19 | 80-89 | 80-89 | ||||||
33 | 32 | 7-4-15 | East | Jones | Pen Set | 62 | 4.99 | 309.38 | 6 | 90-99 | 90-99 | 90-99 | |||||||
34 | 33 | 10-22-14 | East | Jones | Pen | 64 | 8.99 | 575.36 | 0 | 100+ | 100+ | 100+ | |||||||
35 | 34 | 12-29-14 | East | Parent | Pen Set | 74 | 15.99 | 1,183.26 | 6 | 0-9 | Pencil | 13 | 0.302325581 | 30.2% | 0-9 | 0-9 | |||
36 | 35 | 7-29-14 | East | Parent | Binder | 81 | 19.99 | 1,619.19 | 4 | Oct-19 | Binder | 15 | 0.348837209 | 34.9% | Oct-19 | Oct-19 | |||
37 | 36 | 1-6-14 | East | Jones | Pencil | 95 | 1.99 | 189.05 | 4 | 20-29 | Pen | 5 | 0.11627907 | 11.6% | 20-29 | 20-29 | |||
38 | 37 | 4-27-15 | East | Howard | Pen | 96 | 4.99 | 479.04 | 3 | 30-39 | Pen Set | 7 | 0.162790698 | 16.3% | 30-39 | 30-39 | |||
39 | 38 | 8-24-15 | West | Sorvino | Desk | 3 | 275.00 | 825.00 | 2 | 40-49 | Desk | 3 | 0.069767442 | 7.0% | 40-49 | 40-49 | |||
40 | 39 | 3-7-15 | West | Sorvino | Binder | 7 | 19.99 | 139.93 | 6 | 50-59 | 43 | 1 | 100.0% | 50-59 | 50-59 | ||||
41 | 40 | 5-22-14 | West | Thompson | Pencil | 32 | 1.99 | 63.68 | 6 | 60-69 | 60-69 | 60-69 | |||||||
42 | 41 | 3-15-14 | West | Sorvino | Pencil | 56 | 2.99 | 167.44 | 3 | 70-79 | 70-79 | 70-79 | |||||||
43 | 42 | 10-14-15 | West | Thompson | Binder | 57 | 19.99 | 1,139.43 | 3 | 80-89 | Oct-19 | 80-89 | 80-89 | ||||||
44 | 43 | 9-27-15 | West | Sorvino | Pen | 76 | 1.99 | 151.24 | 6 | 90-99 | 90-99 | 90-99 | |||||||
SalesOrders |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H2:H44 | H2 | =G2*F2 |