Sub GPE_boyxin()
iGV = 9: iLop = 5: iMon = 14: iHS = 12
'-----------------------------------------------------
With Application
.ScreenUpdating = False: .Calculation = xlCalculationManual
[a3].CurrentRegion.Offset(2).Resize(, 9).ClearContents
[b3].Resize(iGV) = [l3].Resize(iGV).Value
[d3].Resize(iGV) = [m3].Resize(iGV).Value
Tmp = [a3].Resize(iGV, 9)
For i = 1 To iGV
xLop = "": Tmp(i, 1) = i
G = 0: K = 0: TB = 0: Y = 0: Kem = 0
For j = 1 To iLop
If [m2].Offset(i, j) <> blank Then
xLop = xLop & [m2].Offset(, j) & ", "
ic = .Match([m2].Offset(i), Sheet1.[c2].Resize(, iMon), 0)
For Each iclls In Sheet1.[a3].Resize(iHS)
If iclls = [m2].Offset(, j).Value Then
With Sheet1.Cells(iclls.Row, ic + 2)
If .Value >= 8 Then G = G + 1
If .Value >= 6.5 And .Value < 8 Then K = K + 1
If .Value >= 5 And .Value < 6.5 Then TB = TB + 1
If .Value >= 3.5 And .Value < 5 Then Y = Y + 1
If .Value < 3.5 Then Kem = Kem + 1
End With
End If: Next: End If: Next
Tmp(i, 3) = Left(xLop, Len(xLop) - 2)
Tmp(i, 5) = G: Tmp(i, 6) = K: Tmp(i, 7) = TB: Tmp(i, 8) = Y: Tmp(i, 9) = Kem
Next: [a3].Resize(iGV, 9) = Tmp
.ScreenUpdating = True: .Calculation = xlCalculationAutomatic
End With
End Sub