racebannon
New Member
- Joined
- May 25, 2011
- Messages
- 6
Hi:
I have the following spreadsheet that I need help creating a macro for:
CostCode SpentHours BillableAmount Project Code
010-0040 20 400.00 05424A
040-4104 5 110.00 05424A
101-0150 1 14.00 05424A
010-0040 2 20.00 05426B
030-0670 9 87.00 05426B
400-2470 3 43.00 05426B
200-0060 2 37.00 05426B
I need to have a macro that will copy rows based on groups of CostCodes, for a particular project to new Workbooks.
The grouping of costcodes will vary by project, but generally they follow the below pattern:
010,020,030,040,050,060,070,080,090,950 (using the first three digits of the CostCode)
100,200,300,350,400,450,500,550,600,650
101,201,301,351,401,451,501,551,601,650
102,202,302,352,402,452,502,552,602,652
103,203,303,353,403,453,503,553,603,653
So in the above example I would like the macro to generate the following new workbooks (saved to Sheet1):
FILE: 05424A_1.xls
CostCode SpentHours BillableAmount Project Code
010-0040 20 400.00 05424A
040-4104 5 110.00 05424A
FILE: 05424A_2.xls
CostCode SpentHours BillableAmount Project Code
101-0150 1 14.00 05424A
FILE: 05424B_1.xls
CostCode SpentHours BillableAmount Project Code
010-0040 2 20.00 05426B
030-0670 9 87.00 05426B
FILE: 05424B_2.xls
CostCode SpentHours BillableAmount Project Code
400-2470 3 43.00 05426B
200-0060 2 37.00 05426B
I've taken a look at a lot of macros on the internet, but haven't found one that's close to what I need.
I don't need the macro to ask the user for the groupings of cost codes, I can just change the VB code at the start of a project.
Any help is greatly appreciated, as I'm not good with VB!
I have the following spreadsheet that I need help creating a macro for:
CostCode SpentHours BillableAmount Project Code
010-0040 20 400.00 05424A
040-4104 5 110.00 05424A
101-0150 1 14.00 05424A
010-0040 2 20.00 05426B
030-0670 9 87.00 05426B
400-2470 3 43.00 05426B
200-0060 2 37.00 05426B
I need to have a macro that will copy rows based on groups of CostCodes, for a particular project to new Workbooks.
The grouping of costcodes will vary by project, but generally they follow the below pattern:
010,020,030,040,050,060,070,080,090,950 (using the first three digits of the CostCode)
100,200,300,350,400,450,500,550,600,650
101,201,301,351,401,451,501,551,601,650
102,202,302,352,402,452,502,552,602,652
103,203,303,353,403,453,503,553,603,653
So in the above example I would like the macro to generate the following new workbooks (saved to Sheet1):
FILE: 05424A_1.xls
CostCode SpentHours BillableAmount Project Code
010-0040 20 400.00 05424A
040-4104 5 110.00 05424A
FILE: 05424A_2.xls
CostCode SpentHours BillableAmount Project Code
101-0150 1 14.00 05424A
FILE: 05424B_1.xls
CostCode SpentHours BillableAmount Project Code
010-0040 2 20.00 05426B
030-0670 9 87.00 05426B
FILE: 05424B_2.xls
CostCode SpentHours BillableAmount Project Code
400-2470 3 43.00 05426B
200-0060 2 37.00 05426B
I've taken a look at a lot of macros on the internet, but haven't found one that's close to what I need.
I don't need the macro to ask the user for the groupings of cost codes, I can just change the VB code at the start of a project.
Any help is greatly appreciated, as I'm not good with VB!