Private Function HTGC(Rg As Range)
'Déclaration des variables
Dim i As Long
Dim j As Long
Dim heures As Long
'Programme de la fonction
heures = 0
For j = Rg(, 1).Column To Rg.Columns.Count
For i = Rg(1).Row To Rg.Rows.Count
If Cells(i, j).Value = "TGC" Then
j = j + 1
heures = heures + Cells(i, j).Value
j = j - 1
End If
Next i
Next j
HTGC = heures
End Function