Hello i'm trying to group the CODE values and get a total of the count based on certain instances. i cant use a pivot table when doing this so VBA code is preferred
Then i would like to do the same but for "Coconut" only in the FRUIT2 Column using certain instances
Then i would like to know the only the "Apple" only in the FRUIT1 Column using certain instances.
and so on and so on...for only the Fruit1 fields.
All of this data is on an open workbook, would like move it to another.
Here is my current Code, im just not should what i should do next for sorting.
Here is the Current data i have.
NOTE: Grey and "Blank" should be combined with the white value.
[TABLE="width: 400, align: left"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]CODE[/TD]
[TD="align: center"]FRUIT1[/TD]
[TD="align: center"]FRUIT2[/TD]
[TD="align: center"]YES/NO[/TD]
[TD="align: center"]COLOR[/TD]
[TD="align: center"]COUNT[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CHERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]PINEAPPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]PEAR[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CHERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]PINEAPPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]PEAR[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
Here is the final result im kinda looking for with a total row added below with the Z column blank then starting a new group "COCONUT"
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]T[/TD]
[TD="align: center"]U[/TD]
[TD="align: center"]V[/TD]
[TD="align: center"]W[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]Z[/TD]
[/TR]
[TR]
[TD="align: center"]CODE[/TD]
[TD="align: center"]TOTAL[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: center"]TOTAL-YES[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 71"]
<tbody>[TR]
[TD="width: 71, align: center"]TOTAL-NO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="width: 75, align: center"]TOTAL-RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 93"]
<tbody>[TR]
[TD="width: 93, align: center"]TOTAL-GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="width: 179, align: center"]TOTAL-WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64, align: center"]YES+RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64, align: center"]NO+RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 162"]
<tbody>[TR]
[TD="width: 162, align: center"]YES+GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="width: 75, align: center"]NO+GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="width: 179, align: center"]YES+WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 161"]
<tbody>[TR]
[TD="width: 161, align: center"]NO+WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]TOTAL[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Any Help would be greatly appreciated, ive been trying to wrap my head around how to logically think of a way to sort this out using a macro.
Thanks
Then i would like to do the same but for "Coconut" only in the FRUIT2 Column using certain instances
Then i would like to know the only the "Apple" only in the FRUIT1 Column using certain instances.
and so on and so on...for only the Fruit1 fields.
All of this data is on an open workbook, would like move it to another.
Here is my current Code, im just not should what i should do next for sorting.
Code:
Sub CopyColumnToWorkbook()Dim sourceColumn As Range, targetcolumn As Range
Set sourceColumn = Workbooks("test1.csv").Worksheets(1).Columns("A")
Set targetcolumn = Workbooks("test2.xlsm").Worksheets(1).Columns("A")
sourceColumn.Copy Destination:=targetcolumn
ActiveSheet.Range("A1:A10000").RemoveDuplicates Columns:=Array(1), Header:=xlYes
End Sub
Here is the Current data i have.
NOTE: Grey and "Blank" should be combined with the white value.
[TABLE="width: 400, align: left"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[/TR]
[TR]
[TD="align: center"]CODE[/TD]
[TD="align: center"]FRUIT1[/TD]
[TD="align: center"]FRUIT2[/TD]
[TD="align: center"]YES/NO[/TD]
[TD="align: center"]COLOR[/TD]
[TD="align: center"]COUNT[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CHERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]PINEAPPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]PEAR[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CHERRY[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]RED[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]PINEAPPLE[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREEN[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]PEAR[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"]GREY[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]COCONUT[/TD]
[TD="align: center"]YES[/TD]
[TD="align: center"][/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]APPLE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]ORANGE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]BANANA[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]STRAWBERRY[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]CORN[/TD]
[TD="align: center"]GRAPE[/TD]
[TD="align: center"]NO[/TD]
[TD="align: center"]WHITE[/TD]
[TD="align: center"]1[/TD]
[/TR]
</tbody>[/TABLE]
Here is the final result im kinda looking for with a total row added below with the Z column blank then starting a new group "COCONUT"
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"]A[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]O[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]R[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]T[/TD]
[TD="align: center"]U[/TD]
[TD="align: center"]V[/TD]
[TD="align: center"]W[/TD]
[TD="align: center"]X[/TD]
[TD="align: center"]Y[/TD]
[TD="align: center"]Z[/TD]
[/TR]
[TR]
[TD="align: center"]CODE[/TD]
[TD="align: center"]TOTAL[/TD]
[TD][TABLE="width: 72"]
<tbody>[TR]
[TD="width: 72, align: center"]TOTAL-YES[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 71"]
<tbody>[TR]
[TD="width: 71, align: center"]TOTAL-NO[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="width: 75, align: center"]TOTAL-RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 93"]
<tbody>[TR]
[TD="width: 93, align: center"]TOTAL-GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="width: 179, align: center"]TOTAL-WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64, align: center"]YES+RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR]
[TD="width: 64, align: center"]NO+RED[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 162"]
<tbody>[TR]
[TD="width: 162, align: center"]YES+GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 75"]
<tbody>[TR]
[TD="width: 75, align: center"]NO+GREEN[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 179"]
<tbody>[TR]
[TD="width: 179, align: center"]YES+WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 161"]
<tbody>[TR]
[TD="width: 161, align: center"]NO+WHITE/GREY/BLANK[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]15[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]11[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]6[/TD]
[TD="align: center"]5[/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]TOTAL[/TD]
[TD="align: center"]30[/TD]
[TD="align: center"]20[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]22[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]4[/TD]
[TD="align: center"]0[/TD]
[TD="align: center"]12[/TD]
[TD="align: center"]10[/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Any Help would be greatly appreciated, ive been trying to wrap my head around how to logically think of a way to sort this out using a macro.
Thanks