Jeff Meyers
Active Member
- Joined
- Mar 14, 2012
- Messages
- 405
Scenario:<o></o>
I obtain a CSV file from the accounting system summarizing budget and expense amounts by project grant (i.e. departments) by G/L account. The problem is that it needs to be “cleaned-up” before I can utilize it as it is more like a report than a data table.<o></o>
<o></o>
The linked Excel file has 2 worksheets:<o></o>
· The first worksheet is the CSV import<o></o>
· The second worksheet has been manually processed to my desired data table format<o></o>
<o>
https://www.box.com/s/273a06a2c11c69eb6dd7 </o>
My Goal:<o></o>
To go from the CSV import to the Processed Data Table automatically / programmatically<o></o>
<o></o>
Notes:<o></o>
· The linked file is just a sample that contains the summary for three project grants. There could be up to 40 or so in another CSV import - the number is not static.<o></o>
· The project grant numbers / identifiers arealways in this format: OA#####FY## (ex. OA21680FY12)<o></o>
· Each project grant may have as few as one (1) G/L account up to sixty (60) or so G/L accounts<o></o>
· The G/L account numbers are always in this format: ###### (six digits) (ex. 510040)<o></o>
· The column headings (Row 5 on the CSV Import worksheet) are not aligned properly<o></o>
· The only data that I need from this CSV Import worksheet are in Columns B, C, & D, along with the associated project grant number / identifier. In addition, I only need this data from the rows that contain a G/L account number in Column B. <o></o>
<o></o>
Editing / Sorting/ Processing:<o></o>
I manually edited the data from the first worksheet (CSV Import) to create the second worksheet (Processed) as follows:<o></o>
· I copied the project grant number to Column A. The project grant number precedes the associated G/L accounts in Column B (i.e.“OA21680FY12 - 2 MIPPA AAA” in Cell B7). The project grant number is also at the end of each group of associated G/L accounts in Column A (i.e. “TTLS for OA21680FY12 - 2 MIPPA AAA” in Cell A39). I only desire the project grant number/ identifier (OA21680FY12) and not the project grant name / description. Note that this is the most difficult aspect of this project that I cannot figure out how to automate.<o></o>
· Then I sorted the data by Column B. All rows with G/L account numbers were then grouped together. I then deleted rows above and below my desired data (i.e. blank rows, rows with titles, rows with headings, rows with totals, etc.).<o></o>
· Then I deleted Columns E thru I as I do not need this data / these amounts.<o></o>
· Then I inserted two new columns between A and B and split the new Column D into these 2 new columns as follows:<o></o>
o G/L account number using =--LEFT(D1,6) in Col B<o></o>
o G/L account description using =RIGHT(D1,LEN(D1)-9) in Col C<o></o>
· Then I copied these 2 new columns (B & C)and pasted them as values<o></o>
· Then I deleted column D (the combined G/L account number and the account description)<o></o>
· Then I inserted headings / titles for thefinished data columns in Row 1 (PROJECT GRANT, ACCT #, ACCT DESCRIPTION, BUDGET, & EXPENSE)<o></o>
<o></o>
I will then be able to utilize this resulting data table in analyses, projections, reporting, etc.<o></o>
<o></o>
Additional info:<o></o>
· I am using Excel 2010<o></o>
· I consider myself advanced with Excel<o></o>
· I consider myself a novice with VBA (I can formulate and grasp the concepts / logic - but I am very basic with coding)<o></o>
<o></o>
My goal is to automate this process as much as possible. In an ideal world I would generate the CSV file, import it into Excel, run a macro, and then the end result would be as shown on the Processed worksheet on the linked file.<o></o>
<o></o>
Any direction, assistance, VBA code, coaching, help, etc. would be greatly appreciated. Thank you!<o></o>
<o></o>
I obtain a CSV file from the accounting system summarizing budget and expense amounts by project grant (i.e. departments) by G/L account. The problem is that it needs to be “cleaned-up” before I can utilize it as it is more like a report than a data table.<o></o>
<o></o>
The linked Excel file has 2 worksheets:<o></o>
· The first worksheet is the CSV import<o></o>
· The second worksheet has been manually processed to my desired data table format<o></o>
<o>
https://www.box.com/s/273a06a2c11c69eb6dd7 </o>
My Goal:<o></o>
To go from the CSV import to the Processed Data Table automatically / programmatically<o></o>
<o></o>
Notes:<o></o>
· The linked file is just a sample that contains the summary for three project grants. There could be up to 40 or so in another CSV import - the number is not static.<o></o>
· The project grant numbers / identifiers arealways in this format: OA#####FY## (ex. OA21680FY12)<o></o>
· Each project grant may have as few as one (1) G/L account up to sixty (60) or so G/L accounts<o></o>
· The G/L account numbers are always in this format: ###### (six digits) (ex. 510040)<o></o>
· The column headings (Row 5 on the CSV Import worksheet) are not aligned properly<o></o>
· The only data that I need from this CSV Import worksheet are in Columns B, C, & D, along with the associated project grant number / identifier. In addition, I only need this data from the rows that contain a G/L account number in Column B. <o></o>
<o></o>
Editing / Sorting/ Processing:<o></o>
I manually edited the data from the first worksheet (CSV Import) to create the second worksheet (Processed) as follows:<o></o>
· I copied the project grant number to Column A. The project grant number precedes the associated G/L accounts in Column B (i.e.“OA21680FY12 - 2 MIPPA AAA” in Cell B7). The project grant number is also at the end of each group of associated G/L accounts in Column A (i.e. “TTLS for OA21680FY12 - 2 MIPPA AAA” in Cell A39). I only desire the project grant number/ identifier (OA21680FY12) and not the project grant name / description. Note that this is the most difficult aspect of this project that I cannot figure out how to automate.<o></o>
· Then I sorted the data by Column B. All rows with G/L account numbers were then grouped together. I then deleted rows above and below my desired data (i.e. blank rows, rows with titles, rows with headings, rows with totals, etc.).<o></o>
· Then I deleted Columns E thru I as I do not need this data / these amounts.<o></o>
· Then I inserted two new columns between A and B and split the new Column D into these 2 new columns as follows:<o></o>
o G/L account number using =--LEFT(D1,6) in Col B<o></o>
o G/L account description using =RIGHT(D1,LEN(D1)-9) in Col C<o></o>
· Then I copied these 2 new columns (B & C)and pasted them as values<o></o>
· Then I deleted column D (the combined G/L account number and the account description)<o></o>
· Then I inserted headings / titles for thefinished data columns in Row 1 (PROJECT GRANT, ACCT #, ACCT DESCRIPTION, BUDGET, & EXPENSE)<o></o>
<o></o>
I will then be able to utilize this resulting data table in analyses, projections, reporting, etc.<o></o>
<o></o>
Additional info:<o></o>
· I am using Excel 2010<o></o>
· I consider myself advanced with Excel<o></o>
· I consider myself a novice with VBA (I can formulate and grasp the concepts / logic - but I am very basic with coding)<o></o>
<o></o>
My goal is to automate this process as much as possible. In an ideal world I would generate the CSV file, import it into Excel, run a macro, and then the end result would be as shown on the Processed worksheet on the linked file.<o></o>
<o></o>
Any direction, assistance, VBA code, coaching, help, etc. would be greatly appreciated. Thank you!<o></o>
<o></o>