Optimize spreadsheet-filling routine
It's hard to say exactly how this will be implemented without seeing the entire sub/function, but what you need is a Select Case statement and a For loop. 

Pseudo code to get you started:

    Dim row as Long
    For row = 1 to 24
        Populate row 
    next row

End Sub

Private Sub Populate(ByVal row as Long)
     Dim text as string 
     text = GetText(row)
     Dim value as Variant
     value =  GetValue(row, text)

     Sheets("Groups").Cells(row,1) = text
     Sheets("Groups").Cells(row,2) = value
End Sub

Private Function GetText(ByVal row as Long) As String
    Select Case Row
        Case 1: GetText = "Groups"
        Case 2: GetText = "9N4"
        Case 3: GetText = "1A2A"

        'etc

     End Select
End Function

Private Function GetValue(ByVal row as Long, ByVal matchText as String) As Variant
    If row = 1 Then
        GetValue = "Aantal"
    Else
        GetValue = Application.WorksheetFunction.CountIf(Sheets("totallist").Range("G2:G" &amp; rn_totallist), matchText)
    End If
End Function