Data Merging Question using VBA

Gojira

New Member
Joined
Nov 7, 2017
Messages
17
Hi,

I'm trying to figure out the best approach to a problem and need some advice on tackling it.

I have a set of data I need to import from one workbook into another. The source data is a forecast of time required by different resources to work on a given project and is presented like this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Project ID[/TD]
[TD]Role[/TD]
[TD]Name[/TD]
[TD]Source[/TD]
[TD]Allocated[/TD]
[TD]Notes[/TD]
[TD]Week1[/TD]
[TD]Week2[/TD]
[TD]Week3[/TD]
[TD]Etc[/TD]
[/TR]
[TR]
[TD]Project 1[/TD]
[TD]Engineer[/TD]
[TD]Bob Smith[/TD]
[TD]Perm[/TD]
[TD]Y[/TD]
[TD]Out of Hours only[/TD]
[TD].25[/TD]
[TD].5[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Project 1[/TD]
[TD]Architect[/TD]
[TD]Susan Jones[/TD]
[TD]Contractor[/TD]
[TD]Y[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

In this scenario, the data submitted in the 'Weeks' columns is expected to change as forecasts improve. Historical data (i.e. weeks in the past) is expected to be retained however there is a chance that the submitters will delete 'Week' columns that are in the past.

In addition, new people may be added and there is also a risk that resources that were used early in the project will be deleted by the submitters. So in the example above, there's a chance that Susan Jones will be deleted from the list of resources in week 10 because she's not been used on the project for a few weeks. It shouldn't happen, but it might.

The source data is submitted on a sheet that may contain multiple projects.

I need to be able to extract the data for a single project and add it to a data set in a separate file that is used to track finances. I've figured out how to extract the data for the project in question, and am placing it in a temporary sheet in my destination file.

The challenge I have is how to approach the potential volatility of the data to:
1) Handle changes in the weekly forecasts for resources that are already on the list
2) Handle the addition of resources as new ones are needed for the project
3) Not lose resources that are deleted from the source data - I need to retain them on my destination data
4) Not lose historical 'week' columns.

One of the additional complexities I've got is that a given Name may appear twice, with 'Allocated' set to either Yes or No. This means I don't have a single unique identifier for my data and I'm not sure how to deal with that - otherwise I could just match on name, figure out if any data has changed on that row and then overwrite anything that is still in the future (which I'm not entirely sure how to do, but I think I could figure that out).

Does anyone have any advice on how best to approach this?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top