看看是否符合要求
Sub tst()
Dim i, j, ar, k
With Sheet1
[g:i] = ""
[g1] = "班级": [h1] = "科目": [i1] = "成绩"
ar = [a65536].End(xlUp).Row
For i = 2 To ar
If .Cells(i, 1) <> .Cells(i + 1, 1) Then
j = [g65536].End(xlUp).Row
For k = 1 To 4
.Cells(k + j, 7) = .Cells(i, 1)
.Cells(k + j, 8) = .Cells(1, 1 + k)
.Cells(k + j, 9) = .Cells(i, 1 + k)
Next
End If
Next
End With
End Sub