Do I need a nested for Loop?

Rcoates

New Member
Joined
Apr 15, 2011
Messages
5
Hi,

I am hoping to get pointed in the right direction.

I am going to attempt to write a macro with three sheets. Transactions, Accounts, and Output.

On the transactions tab all of the companies with company ID (col A), the transaction amount (col E), Description (col D) and date (col B) will be included.

On the Accounts, all of the individuals by Personal ID (Col B) who own that company ID (Col A) will be listed with their ownership percantage (Col D).

The goal is to write a macro that will count the number of transactions, and for each transaction then multiply the ownership percentage (accts tab) for each individual by the transaction amount.

Ex. IF there are two transactions amounts on the transactions tab.
Company A = -20000 Buy on 10/1/2011
Company B = +10000 Sell on 11/8/2011

The Accounts tab would have:
Company A has 2 owners, Man1 @ 25% and Man2 @75%
Company B has 3 owners, Woman1@ 50%, Woman2@ 20% and Man1@ 30%

My goal is to see on the output tab.

Company A; Man1; 10/1/2011; -5000; Buy
Company A; Man2; 10/1/2011; -15000; Buy
Company B; Woman1; 11/8/2010; +5000; Sell
Company B; Woman2; 11/8/2010; +2000; Sell
Company B; Man1; 11/8/2010; +3000; Sell

I am hoping for this to be dynamic as the amount of transactions will always be different. I am looking to be pointed in the right direction before I start this, any help would be greatly appreciated.

Thanks,
Ross
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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