Hello,
Can you please help me with a macro that I am trying to create. I tried recording the macro for this but it was not working and I am relatively new to macros and VBA. Have been using excel but was able to record macros so far for what I wanted to do , until this time
We get these 2 reports in different worksheets from our reps and other people working on the project, the format of the reports remains the same but the data in them changes based on the project.
What I want to do is be able to pull in the reports into one workbook (budget and tasks) as worksheets and then find the exceptions between them. I have been successfully able to write a macro to “import” these worksheets into one workbook but then I need help in finding exceptions and creating three worksheets based on that data.
1. Budget: This worksheet has the budget information assigned to each code and the person that is responsible for the tasks.
2. Tasks: This is the worksheet that has the information about the tasks and schedule, assigned to a code and the person responsible for it.
3. Common: This worksheet will have the fields that are common to both tasks and budget, the data has “codes” and the primary key and the name as the “secondary key” to associate all the data with each other.
4. budget exceptions: this worksheet will have the rows that are present in the budget worksheet but NOT in the tasks.
5. task exceptions: Similarly this will have the rows/data that are present in the tasks worksheet but NOT in the budget sheet.
My thought process that I have been trying to implement is
1. Import the worksheets (I am already done and can do this with my macro)
2. Take the first code and name in the first row of budget worksheet and then scan through the tasks sheet and if they match then put them in the “common” worksheet or else put them in the “budget exception” worksheet.
3. If the data matches and its the first time then color code the row otherwise simply paste it!
4. If the data is present in the tasks sheet but not in the budget sheet then do something similar and paste it in the “tasks exception” sheet.
Can you guys please help me with this? I dont know how to figure this out on my own. Any pointers or help with be really really helpful.
I have also attached a sample sheet with budget and tasks (these are the ones that are imported, the data changes but the format remains the same, sometimes they only have 5-0 rows and sometimes in excess of 300 rows, depending on the project). and common, budget_exceptions and tasks_exceptions as the worksheets that I am trying to get.
Thanks for the forums guys, I came here last night while googling and have been hooked, there’s so much to learn here !!
Bookmarks