PDA

View Full Version : Help!!!!



tub04738
05-14-2010, 07:03 AM
I have one task that requires me to combine cells in a certain way. Here is the small portion of my data:
1m 2m 3m 4m 5m 6m
Jan 1 2 3 4 5 6
Feb 2 3 4 5 6 7
Mar 3 4 5 6 7 8
Apr 4 5 6 7 8 9
May 5 6 7 8 9 10
Jun 6 7 8 9 10 11
I need to combine (Jan-98,1m), (Jan-98,2m), (Jan-98,3m), (Feb-98,1m), (Feb-98,2m), (Feb-98,3m), (Mar-98, 1m), (Mar-98,2m) and (Mar-98,3m).
This will become my first combined data. Then after that I will have to continue combining (Jan-98,4m) (jan-98,5m) (Jan-98,6m), (Feb-98,4m),(feb-98,5m), (Feb-98, 6m), (Mar-98,4m), (Mar-98,5m) and (Mar-98,6m).
Then do the same thing to April-98 , May-98 and June-98.

The final result should look like this :
1m 2m
quarter1 27 54
quarter2 54 81

I tried something like this but it requires constantly changing my rows and columns:
Sub LoopTest()
For j = 20 To 30 Step 3
For i = 1 To 62 Step 3
Cells(j, i) = "=SUM(R[-18]C[1]:R[-16]C[3])"
Next i
Next j
End Sub


Can anyone help me?

tub04738
05-14-2010, 07:10 AM
Sorry there should be no"98" after each month............

Simon Lloyd
05-14-2010, 07:40 AM
Please supply a sample workbook so we can see the structure and layout of your data.