Sub Main()
Dim iCount As Integer, iCol As Integer, iFrow As Integer, iRow As Integer
Dim iI As Integer, iJ As Integer
Dim rC As Range
With Sheets("原稿")
With .Range("a1:m1")
Set rC = .Find("學校", LookIn:=xlValues)
If Not rC Is Nothing Then
iCol = rC.Column
End If
End With
iCount = .Cells(Rows.Count, iCol).End(xlUp).Row()
.Range(Cells(2, 14), Cells(iCount, 20)).Clear
For iI = 1 To 7
With .Range(Cells(1, iCol), Cells(iCount, iCol))
Set rC = .Find(Cells(1, 13 + iI), LookIn:=xlValues)
If Not rC Is Nothing Then
iJ = 0
iFrow = rC.Row
Do
iJ = iJ + 1
iRow = rC.Row
Cells(iRow, 13 + iI) = iJ
Set rC = .FindNext(rC)
Loop While Not rC Is Nothing And rC.Row <> iFrow
End If
End With
Next iI
End With
End Sub