# From macro to vba

#### montecarlo2012

##### Well-known Member
Hello everyone.
I am here trying to see the transformation from a simple Macro to a Code, I know guy for you is something so Simple, but “ sorry “ no for me, I am a new self-thaught bee.
I just sum two numbers with the macro recorder I got this:

Range("H2").Select
ActiveCell.Formula = "=SUM(A2:B2)"

So with my Basic knowledge I see that H2 has to be a variable, sum I can think as a total, or another variable, and the two location as well, so I got this:

Sub real_code()
Dim H As Integer, A As Integer, B As Integer
A = Range("A2").Value: B = Range("B2").Value
H = A + B
Range("H1").Value = H
End Sub

And “”Bingo”” work well.

But now I intent to transform the macro using the function COUNT,

Sub C_m()
Range("H6").Select
ActiveCell.Formula = "=COUNT(B:B)"
End Sub

BUT then, I realize my logic do not worked as before, the only thing
So far, I can see is, must be a loop, how I will deduce that?, “ I don’t know” that why I am here.
Thank you.

### Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

#### DanteAmor

##### Well-known Member
What do you need?
Forget the macro and the code for a moment, you can explain with your words what you want to do.

#### montecarlo2012

##### Well-known Member
wow, thank you so much Mr. D a n t e A m o r, your offer is really Priceless.
explain with your words what you want to do.
Still I am in the same idea of counting my Dynamic Array.
Code:
``````Sub DanteAmor()    Dim r As Range, wMin As Double, wMax As Double, wRow As Long, wCol As Long, i As Long, j As Long

Set r = Range("A1", Range("A" & Rows.Count).End(xlUp))
wMin = WorksheetFunction.Min(r)
wMax = WorksheetFunction.Max(r)
r.Offset(0, 2).Resize(r.Count, wMax + 1).ClearContents

wRow = 2
For i = wMin To wMax
wCol = 4
Cells(wRow, "C").Value = i
For j = wMin To wMax
Cells(1, wCol).Value = j
Cells(wRow, wCol).Value = Evaluate("SUM((" & r.Address & "=" & j & ")*(" & r.Offset(1).Address & "=" & i & "))")
wCol = wCol + 1
Next
wRow = wRow + 1
Next
MsgBox "Done"
End Sub``````
in this code, you know count one column and displays a matrix, so now I would like count a dynamic array of six columns (B2:G2600) and the numbers in this array is a set from one to 53 the maximun number.
Code:
``````[TABLE="width: 259"]
<colgroup><col span="7"></colgroup><tbody>[TR]
[TD] [/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD="align: right"]1[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]49[/TD]
[/TR]
[TR]
[TD="align: right"]2[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]49[/TD]
[/TR]
[TR]
[TD="align: right"]3[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]25[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]23[/TD]
[/TR]
[TR]
[TD="align: right"]4[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]47[/TD]
[/TR]
[TR]
[TD="align: right"]5[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]48[/TD]
[/TR]
[TR]
[TD="align: right"]6[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]20[/TD]
[/TR]
[TR]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]48[/TD]
[/TR]
[TR]
[TD="align: right"]8[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]42[/TD]
[/TR]
[TR]
[TD="align: right"]9[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]47[/TD]
[/TR]
[TR]
[TD="align: right"]10[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]35[/TD]
[TD="align: right"]34[/TD]
[/TR]
[TR]
[TD="align: right"]11[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]46[/TD]
[/TR]
[TR]
[TD="align: right"]12[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]26[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]48[/TD]
[/TR]
[TR]
[TD="align: right"]13[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]32[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]42[/TD]
[/TR]
[TR]
[TD="align: right"]14[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]42[/TD]
[/TR]
[TR]
[TD="align: right"]15[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]42[/TD]
[/TR]
[TR]
[TD="align: right"]16[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]28[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]47[/TD]
[TD="align: right"]38[/TD]
[/TR]
[TR]
[TD="align: right"]17[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]26[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]42[/TD]
[TD="align: right"]48[/TD]
[/TR]
[TR]
[TD="align: right"]18[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD="align: right"]19[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]35[/TD]
[/TR]
[TR]
[TD="align: right"]20[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD="align: right"]21[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]44[/TD]
[/TR]
[TR]
[TD="align: right"]22[/TD]
[TD="align: right"]16[/TD]
[TD="align: right"]20[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]40[/TD]
[TD="align: right"]47[/TD]
[/TR]
[TR]
[TD="align: right"]23[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]44[/TD]
[TD="align: right"]41[/TD]
[/TR]
[TR]
[TD="align: right"]24[/TD]
[TD="align: right"]10[/TD]
[TD="align: right"]16[/TD]
[TD="align: right"]21[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]41[/TD]
[TD="align: right"]46[/TD]
[/TR]
[TR]
[TD="align: right"]25[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]27[/TD]
[TD="align: right"]43[/TD]
[/TR]
[TR]
[TD="align: right"]26[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]8[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]34[/TD]
[TD="align: right"]43[/TD]
[TD="align: right"]40[/TD]
[/TR]
[TR]
[TD="align: right"]27[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]12[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]45[/TD]
[/TR]
[TR]
[TD="align: right"]28[/TD]
[TD="align: right"]9[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]29[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]40[/TD]
[/TR]
[TR]
[TD="align: right"]29[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]15[/TD]
[TD="align: right"]24[/TD]
[TD="align: right"]30[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]44[/TD]
[/TR]
[TR]
[TD="align: right"]30[/TD]
[TD="align: right"]17[/TD]
[TD="align: right"]19[/TD]
[TD="align: right"]23[/TD]
[TD="align: right"]31[/TD]
[TD="align: right"]33[/TD]
[TD="align: right"]49[/TD]
[/TR]
</tbody>[/TABLE]``````
and the matrix will be
Code:
``````[TABLE="width: 512"]
<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl66, width: 64"]O[/TD]
[TD="class: xl66, width: 64"]P[/TD]
[TD="class: xl66, width: 64"]Q[/TD]
[TD="class: xl66, width: 64"]R[/TD]
[TD="class: xl66, width: 64"]S[/TD]
[TD="class: xl66, width: 64"]T[/TD]
[TD="class: xl66, width: 64"]ETC[/TD]
[/TR]
[TR]
[TD="class: xl65"] [/TD]
[TD="class: xl65"]FROM   1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"]UNTIL   53[/TD]
[/TR]
[TR]
[TD="class: xl65"]FROM    1[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65"]UNTIL[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]53[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[/TR]
</tbody>[/TABLE]``````

Last edited:

#### DanteAmor

##### Well-known Member
And what is the result you expect in the matrix?
You could explain a couple of examples with the data that you put.

#### montecarlo2012

##### Well-known Member
And what is the result you expect in the matrix?
You could explain a couple of examples with the data that you put.
So, Sorry DanteAmor
 1 2 3 4 5 6 7 1 37 30 25 29 23 24 21 2 30 21 25 26 15 16 11 3 31 35 15 23 22 18 13 4 29 21 22 21 25 16 11 5 19 18 20 23 11 19 13 6 24 20 21 14 14 9 18 7 24 16 13 20 10 16 7 8 20 9 11 7 13 10 2 9 13 6 12 10 8 2 9 10 10 2 14 13 5 8 10

<tbody>
</tbody>
instead of search into one column, this time will count 6 columns and display how many time each number follow each number, the random numbers in this array are a set of 1 to 53. Thank you for your time.

Last edited:

#### DanteAmor

##### Well-known Member
You can explain how you get a 37 and how you get a 30

 1 2 1 37 30 2

<tbody>
</tbody>

#### montecarlo2012

##### Well-known Member
You can explain how you get a 37 and how you get a 30

 1 2 1 37 30 2

<tbody>
</tbody>
The fact is, those numbers are just an example, about how looks like.
In other words if I don't have the code I really don't know what the real results will be.
Sorry.

#### DanteAmor

##### Well-known Member
The fact is, those numbers are just an example, about how looks like.
In other words if I don't have the code I really don't know what the real results will be.
Sorry.
But to make the code, I need you to explain how to get to the result.

Forget the code for a moment.
What do you want to do? Do you want to add, or to count, what does it mean?

#### montecarlo2012

##### Well-known Member
One post before, with Your code I was able to get the results from one column only. Now I would like to get the results no just from one column, I need to COUNT in each column.
COUNT.
More or less let say, is to expand your code, and instead to count only the column in the example, count the whole entire DYNAMIC array.
Code:
``````[TABLE="width: 1024"]
<colgroup><col width="64" span="16" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64"]B[/TD]
[TD="class: xl65, width: 64"]C[/TD]
[TD="class: xl65, width: 64"]D[/TD]
[TD="class: xl65, width: 64"]E[/TD]
[TD="class: xl65, width: 64"]F[/TD]
[TD="class: xl65, width: 64"]G[/TD]
[TD="class: xl65, width: 64"]H [/TD]
[TD="class: xl65, width: 64"]I [/TD]
[TD="class: xl65, width: 64"]J[/TD]
[TD="class: xl65, width: 64"]K[/TD]
[TD="class: xl65, width: 64"]L[/TD]
[TD="class: xl65, width: 64"]M[/TD]
[TD="class: xl65, width: 64"]N[/TD]
[TD="class: xl65, width: 64"] [/TD]
[TD="class: xl65, width: 64, align: right"]13[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]12[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]12[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]37[/TD]
[TD="class: xl65, align: right"]30[/TD]
[TD="class: xl65, align: right"]31[/TD]
[TD="class: xl65, align: right"]29[/TD]
[TD="class: xl65, align: right"]19[/TD]
[TD="class: xl65, align: right"]24[/TD]
[TD="class: xl65, align: right"]24[/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]30[/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]35[/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]18[/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]25[/TD]
[TD="class: xl65, align: right"]25[/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65, align: right"]22[/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]8[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]29[/TD]
[TD="class: xl65, align: right"]26[/TD]
[TD="class: xl65, align: right"]23[/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]23[/TD]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]23[/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65, align: right"]22[/TD]
[TD="class: xl65, align: right"]25[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]9[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]24[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]18[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]19[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]18[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]6[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65, align: right"]17[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]5[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]19[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]6[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]13[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]11[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]14[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]17[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]18[/TD]
[TD="class: xl65, align: right"]6[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65, align: right"]6[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]19[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]17[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]18[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]19[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]22[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]23[/TD]
[TD="class: xl65, align: right"]16[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]21[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]24[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]22[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]25[/TD]
[TD="class: xl65, align: right"]10[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]23[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]26[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]24[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]3[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]27[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]25[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]28[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]26[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]4[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]29[/TD]
[TD="class: xl65, align: right"]9[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]27[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]30[/TD]
[TD="class: xl65, align: right"]7[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]28[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]31[/TD]
[TD="class: xl65, align: right"]17[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]29[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]32[/TD]
[TD="class: xl65, align: right"]12[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]30[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]33[/TD]
[TD="class: xl65, align: right"]8[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]31[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]34[/TD]
[TD="class: xl65, align: right"]15[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]32[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]35[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]33[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]36[/TD]
[TD="class: xl65, align: right"]20[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]34[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]37[/TD]
[TD="class: xl65, align: right"]2[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]35[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]1[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
[TR]
[TD="class: xl65, align: right"]38[/TD]
[TD="class: xl65, align: right"]5[/TD]
[TD="class: xl65"] [/TD]
[TD="class: xl65, align: right"]36[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[TD="class: xl65, align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]``````
AND THIS IS YOUR CODE FROM THE LAST POST.
Code:
``````  Sub g_n()    Dim r As Range, wMin As Double, wMax As Double, wRow As Long, wCol As Long, i As Long, j As Long

Set r = Range("A1", Range("A" & Rows.Count).End(xlUp))
wMin = WorksheetFunction.Min(r)
wMax = WorksheetFunction.Max(r)
r.Offset(0, 2).Resize(r.Count, wMax + 1).ClearContents

wRow = 2
For i = wMin To wMax
wCol = 4
Cells(wRow, "C").Value = i
For j = wMin To wMax
Cells(1, wCol).Value = j
Cells(wRow, wCol).Value = Evaluate("SUM((" & r.Address & "=" & j & ")*(" & r.Offset(1).Address & "=" & i & "))")
wCol = wCol + 1
Next
wRow = wRow + 1
Next
MsgBox "Done"
End Sub``````

Last edited:

#### DanteAmor

##### Well-known Member
Try this.

The result will begin in column I

Code:
``````Sub g_n()
Dim r As Range, wMin As Double, wMax As Double, wRow As Long
Dim cini As Long, wCol As Long, i As Long, j As Long

Application.ScreenUpdating = False
Set r = Range([COLOR=#0000ff]"B1", Range("G" & Rows.Count).End(xlUp)[/COLOR])
wMin = WorksheetFunction.Min(r)
wMax = WorksheetFunction.Max(r)
cini = r.Columns.Count + 3
Range(Cells(1, cini), Cells(Rows.Count, Columns.Count)).ClearContents

wRow = 2
For i = wMin To wMax
wCol = cini + 1
Cells(wRow, cini).Value = i
For j = wMin To wMax
Cells(1, wCol).Value = j
Cells(wRow, wCol).Value = Evaluate("SUM((" & r.Address & "=" & j & ")*(" & r.Offset(1).Address & "=" & i & "))")
wCol = wCol + 1
Next
wRow = wRow + 1
Next
Application.ScreenUpdating = False
MsgBox "Done"
End Sub``````
Note:
For a matrix of: B2:G2600, the macro will take a long time.