Hi,
I need your help.
My task here is to create a VB Macro. I have my codes here, I just copied the column from another sheet
Worksheets("Report").Select
Sheets("Detailed").Columns(2).Copy Destination:=Sheets("Report").Columns(1)
Sheets("Detailed").Columns(9).Copy Destination:=Sheets("Report").Columns(2)
Sheets("Detailed").Columns(10).Copy Destination:=Sheets("Report").Columns(3)
Sheets("Detailed").Columns(11).Copy Destination:=Sheets("Report").Columns(4)
This is my Data.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Gabby[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Gabby[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]AND SO ON[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
This is my desired output..
I have to get the sum of all the columns 2, 3, and 4 based on the column 1, and then I have to divide Column 3 and Column 4 (COL3/COL4) and place it to the 5th Column
[TABLE="width: 500"]
<tbody>[TR]
[TD]Gabby[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]7[/TD]
[TD]0.71[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]13[/TD]
[TD]0.46[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]1.4[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]7[/TD]
[TD]6[/TD]
[TD]1.67[/TD]
[/TR]
</tbody>[/TABLE]
How will I come up with my desired output?
I need your help.
My task here is to create a VB Macro. I have my codes here, I just copied the column from another sheet
Worksheets("Report").Select
Sheets("Detailed").Columns(2).Copy Destination:=Sheets("Report").Columns(1)
Sheets("Detailed").Columns(9).Copy Destination:=Sheets("Report").Columns(2)
Sheets("Detailed").Columns(10).Copy Destination:=Sheets("Report").Columns(3)
Sheets("Detailed").Columns(11).Copy Destination:=Sheets("Report").Columns(4)
This is my Data.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Gabby[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Gabby[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]4[/TD]
[TD]5[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]6[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]0[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]2[/TD]
[TD]5[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]4[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]AND SO ON[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
This is my desired output..
I have to get the sum of all the columns 2, 3, and 4 based on the column 1, and then I have to divide Column 3 and Column 4 (COL3/COL4) and place it to the 5th Column
[TABLE="width: 500"]
<tbody>[TR]
[TD]Gabby[/TD]
[TD]1[/TD]
[TD]5[/TD]
[TD]7[/TD]
[TD]0.71[/TD]
[/TR]
[TR]
[TD]Sonny[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]13[/TD]
[TD]0.46[/TD]
[/TR]
[TR]
[TD]Zeny[/TD]
[TD]2[/TD]
[TD]7[/TD]
[TD]5[/TD]
[TD]1.4[/TD]
[/TR]
[TR]
[TD]Pat[/TD]
[TD]0[/TD]
[TD]7[/TD]
[TD]6[/TD]
[TD]1.67[/TD]
[/TR]
</tbody>[/TABLE]
How will I come up with my desired output?