Per cominciare, crea la tabella dei risultati con una sola intestazione Verticale, come da immagine:

Poi dovresti poter usare questa macro:
- Codice: Seleziona tutto
Sub OneMore()
Dim PreFix As String, I As Long, Mess As String, J As Long
Dim LastA As Long, hAdr, cIx As Long, cErr As Long, iXErr As String
'
PreFix = "Gr_"
LastA = Cells(Rows.Count, "A").End(xlUp).Row
Range(Range("H3"), Range("H3").End(xlDown)).Offset(0, 1).Resize(, 20).ClearContents
For I = 2 To LastA
For J = I + 1 To I + 100
If Cells(J, "A").Value = "Pron" Or Cells(J, "A").Value = "" Then I = J - 1: Exit For
cIx = Cells(J, "A").Value
hAdr = Application.Match(PreFix & Cells(I, "F"), Range("A2:AN2"), False)
If IsError(hAdr) Then
cErr = cErr + 1
If cErr = 1 Then iXErr = Cells(I, "F")
Else
Cells(cIx + 2, hAdr) = Cells(cIx + 2, hAdr) + 1
End If
Next J
Next I
Mess = "Completato..."
If cErr > 0 Then Mess = Mess & vbCrLf & "Errore su codice " & iXErr & " Errori tot: " & cErr
MsgBox (Mess)
End Sub
Il messaggio finale segnalera' eventuali intestazioni mancanti, il totale errori e l'intestazione del primo errore.
Ciao