I'm not sure if this is even possible using VBA and it's hard to explain, but I'll give it a try. Ive been trying to figure this out for a few weeks with no luck. Basically, I have two worksheets with different payroll related data. Below is some sample data. On sheet1, I have 4 columns showing that the individuals payroll is split 50/50 between "Account1" and "Account2. Then, on sheet2, I have 3 columns. Column A has the individuals name, column B has the account, and column C has the correct % allocation that the individuals payroll needs to be split by.
The % allocations on sheet1 (50/50 b/w Account-1 and Account-2 in the example below) are incorrect. Sheet2 has the correct allocation (60/20/20) for the individual. So, what I have been having to manually do, is figure out the total $ amount for the individual for SALY, USM, and USS, and then re-splitting out that amount by the correct % allocations.
Is this is even possible using VBA?
[TABLE="width: 276"]
<colgroup><col width="125" style="width: 94pt; mso-width-source: userset; mso-width-alt: 4437;"> <col width="86" style="width: 64pt; mso-width-source: userset; mso-width-alt: 3043;"> <col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2673;"> <col width="83" style="width: 62pt; mso-width-source: userset; mso-width-alt: 2958;"> <tbody>[TR]
[TD="class: xl69, width: 369, bgcolor: transparent, colspan: 4"]Starting data on Sheet1[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]$ Amount[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 50.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 50.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, bgcolor: transparent, colspan: 3"]Adjustments to be made on Sheet2[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, bgcolor: transparent, colspan: 4"]Desired outcome on Sheet3[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]$ Amount[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 60.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 20.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 20.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 6.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 6.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
</tbody>[/TABLE]
The % allocations on sheet1 (50/50 b/w Account-1 and Account-2 in the example below) are incorrect. Sheet2 has the correct allocation (60/20/20) for the individual. So, what I have been having to manually do, is figure out the total $ amount for the individual for SALY, USM, and USS, and then re-splitting out that amount by the correct % allocations.
Is this is even possible using VBA?
[TABLE="width: 276"]
<colgroup><col width="125" style="width: 94pt; mso-width-source: userset; mso-width-alt: 4437;"> <col width="86" style="width: 64pt; mso-width-source: userset; mso-width-alt: 3043;"> <col width="75" style="width: 56pt; mso-width-source: userset; mso-width-alt: 2673;"> <col width="83" style="width: 62pt; mso-width-source: userset; mso-width-alt: 2958;"> <tbody>[TR]
[TD="class: xl69, width: 369, bgcolor: transparent, colspan: 4"]Starting data on Sheet1[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]$ Amount[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 50.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 50.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 5.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]50%[/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, bgcolor: transparent, colspan: 3"]Adjustments to be made on Sheet2[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[TD="bgcolor: transparent"][/TD]
[/TR]
[TR]
[TD="class: xl68, bgcolor: transparent, colspan: 4"]Desired outcome on Sheet3[/TD]
[/TR]
[TR]
[TD="class: xl72, bgcolor: transparent"]Name[/TD]
[TD="class: xl72, bgcolor: transparent"]Account[/TD]
[TD="class: xl72, bgcolor: transparent"]$ Amount[/TD]
[TD="class: xl72, bgcolor: transparent"]Allocation[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 60.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 20.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - SALY[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 20.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 6.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USM[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-1[/TD]
[TD="class: xl66, bgcolor: transparent"] 6.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]60%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-2[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
[TR]
[TD="class: xl65, bgcolor: transparent"]John Smith - USS[/TD]
[TD="class: xl65, bgcolor: transparent"]Account-3[/TD]
[TD="class: xl66, bgcolor: transparent"] 2.00 [/TD]
[TD="class: xl67, bgcolor: transparent, align: right"]20%[/TD]
[/TR]
</tbody>[/TABLE]