Macro to allocate line item data

vettetax

New Member
Joined
Jul 5, 2006
Messages
47
My 'Data sheet' contains a combination of values on each row. Certain rows require special allocations, the combination of which is referenced on my 'Allocations' sheet. Certain rows are fine and should not be allocated, but merely left in its virgin state and copied over to the 'Revised Data' sheet. The revised allocated data should then be appropriately referenced on the 'Revised Data' sheet.

Appreciate any help and thank you!


Data Sheet
[TABLE="width: 942"]
<tbody>[TR]
[TD]test1[/TD]
[TD]Combo1[/TD]
[TD]Label1[/TD]
[TD]Label2[/TD]
[TD]Label3[/TD]
[TD]Label4[/TD]
[TD]Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Cat/Dog/House[/TD]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]House[/TD]
[TD]Combo[/TD]
[TD]100[/TD]
[TD]<----value needs to be allocated and Label4 value re-labeled[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Cat/Dog/Bird[/TD]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]Bird[/TD]
[TD]Combo[/TD]
[TD]100[/TD]
[TD]<----control data, no impact as Combo1 value is not on the Allocations tab[/TD]
[/TR]
</tbody>[/TABLE]

Allocation Sheet
[TABLE="width: 247"]
<tbody>[TR]
[TD]Combo1[/TD]
[TD]Merlin[/TD]
[TD]Halo[/TD]
[TD]Max[/TD]
[/TR]
[TR]
[TD]Cat/Dog/House[/TD]
[TD]25%[/TD]
[TD]25%[/TD]
[TD]50%[/TD]
[/TR]
</tbody>[/TABLE]

Revised Data sheet [TABLE="width: 774"]
<tbody>[TR]
[TD]Label1[/TD]
[TD]Label2[/TD]
[TD]Label3[/TD]
[TD]Label4[/TD]
[TD]Allocated Value[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]House[/TD]
[TD]Merlin[/TD]
[TD]25[/TD]
[TD]<----Combo1 value respectively allocated and Label4 value re-labeled[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]House[/TD]
[TD]Halo[/TD]
[TD]25[/TD]
[TD]<----Combo1 value respectively allocated and Label4 value re-labeled[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]House[/TD]
[TD]Max[/TD]
[TD]50[/TD]
[TD]<----Combo1 value respectively allocated and Label4 value re-labeled[/TD]
[/TR]
[TR]
[TD]Cat[/TD]
[TD]Dog[/TD]
[TD]Bird[/TD]
[TD]Combo[/TD]
[TD]100[/TD]
[TD]<----control data, no impact as Combo1 value is not on the Allocations tab[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
If you were to unpivot your allocation sheet, you could setup a sql left join of your data and allocation sheets using MS Query in excel. Then with a simple formula in the resulting table, your could manage your allocation.

This page explains how it can be accomplished. It uses an addin to simplify the ms query sql left join stuff, but the premise is there.
http://www.iwishexcel.com/authors-favorites/2table-left-join/
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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