SPLIT AMOUNT BY MACRO

K

K

Hi,
In column "A" of "Sheet 1" I have codes like "A" , "B" , "C" which
indicates that how amount should be split into months of a year and in
column "B" of "Sheet 1" I have amount figures against the codes which
are in column "A".

A B -------columns
A 1000
B 2000
C 3000

In cells "A1:D14" of "Sheet 2" I have percentage data table which
indicates that which code in coloumn "A" of "Sheet 1" should split
amount (which is in column "B" cells) into which way (please see the
data table below)

A B C D ----Columns
Month A B C ----Headings
200701 8 0 10---percentages
200702 8 0 10
200703 9 0 10
200704 8 0 10
200705 8 0 10
200706 9 14 10
200707 8 14 10
200708 8 15 10
200709 9 14 10
200710 8 14 10
200711 8 15 0
200712 9 14 0
Total 100 100 100

(please not that in column "A" of "Sheet 2" Month is coded as 200701
which mean that year 2007 and 01 first month)
I want macro which should be set on a button and it should cover the
Range ("A2:B10") of "Sheet 1" and it should put the results on "Sheet
3" leaving the first row as that will be use for Headings. Macro
should work as when I put any code from "A to C" in cell "A2 of column
"A" of "Sheet 1" and any amount in column "B" against the code then it
should split that amount the way its shown in "Sheet 2" percentage
data table and put the result in "Sheet 3" and when i put another code
in cell "A3" of column "A" in "Sheet 1" and any other amount in column
"B" then it should again split the amount and now it should put the
result in "Sheet 3" but below the fist result.
FOR EXAMPLE if I put data in "Sheet 1" from cell "A2 of column "A" as
shown below

A B -------columns
A 1000
B 2000
C 3000

Then Macro should produce result in "Sheet 3" as shown below

A B C ------Columns
Month Code Amt -----Headings
200701 A 80
200702 A 80
200703 A 90
200704 A 80
200705 A 80
200706 A 90
200707 A 80
200708 A 80
200709 A 90
200710 A 80
200711 A 80
200712 A 90
200701 B 0
200702 B 0
200703 B 0
200704 B 0
200705 B 0
200706 B 280
200707 B 280
200708 B 300
200709 B 280
200710 B 280
200711 B 300
200712 B 280
200701 C 300
200702 C 300
200703 C 300
200704 C 300
200705 C 300
200706 C 300
200707 C 300
200708 C 300
200709 C 300
200710 C 300
200711 C 0
200712 C 0

I'll be very greatful if anybody can help as this macro will make lots
of people jobs easy. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top