Il s'agit d'une fonction en VBA
Function GIR (UneChaine As Variant) As Integer
'Mise à jour du 31/3/1999
If Len(UneChaine) < 8 Then
GIR = 0
Exit Function
End If
'Teste UneChaine pour le groupe A
groupe = 0
If Left$(UneChaine, 1) = "C" Then groupe = 2000
If Mid$(UneChaine, 2, 1) = "C" Then groupe = groupe + 1200
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 60
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 100
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 800
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 200
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 20
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 120
If Mid$(UneChaine, 8, 1) = "B" Then groupe = groupe + 32
'Rang groupe A
Select Case groupe
Case Is >= 4380
Rang = 1
Case 4140 To 4379
Rang = 2
Case 3390 To 4139
Rang = 3
End Select
If Rang <> 0 GoTo GIR '------LIRE If Rang 'différent de' 0 ...
'
'Teste Une Chaine pour le groupe B
groupe = 0
If Left$(UneChaine, 1) = "C" Then groupe = 1500
If Mid$(UneChaine, 2, 1) = "C" Then groupe = groupe + 1200
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 60
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 100
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 800
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe - 80
If Left$(UneChaine, 1) = "B" Then groupe = groupe + 320
If Mid$(UneChaine, 2, 1) = "B" Then groupe = groupe + 120
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 0
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 120
If Mid$(UneChaine, 8, 1) = "B" Then groupe = groupe - 40
'Rang groupe B
If groupe >= 2016 Then
Rang = 4: GoTo GIR
Else
Rang = 0
End If
'Teste Une Chaine pour le groupe C
groupe = 0
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 40
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 60
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 160
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 1000
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 16
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 20
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 20
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 8, 1) = "B" Then groupe = groupe + 40
'Rang groupe C
Select Case groupe
Case Is >= 1700
Rang = 5
Case 1432 To 1699
Rang = 6
End Select
If Rang <> 0 GoTo GIR '------LIRE If Rang 'différent de' 0 ...
'Teste Une Chaine pour le groupe D
groupe = 0
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 2000
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 2000
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 200
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 200
'Rang groupe D
If groupe >= 2400 Then
Rang = 7: GoTo GIR
Else
Rang = 0
End If
'Teste Une Chaine pour le groupe E
groupe = 0
If Left$(UneChaine, 1) = "C" Then groupe = 400
If Mid$(UneChaine, 2, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 800
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 800
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 200
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 100
'Rang groupe E
If groupe >= 1200 Then
Rang = 8: GoTo GIR
Else
Rang = 0
End If
'Teste Une Chaine pour le groupe F
groupe = 0
If Left$(UneChaine, 1) = "C" Then groupe = 200
If Mid$(UneChaine, 2, 1) = "C" Then groupe = groupe + 200
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 200
If Left$(UneChaine, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 2, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 100
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 100
'Rang groupe F
If groupe >= 800 Then
Rang = 9: GoTo GIR
Else
Rang = 0
End If
'Teste Une Chaine pour le groupe G
groupe = 0
If Left$(UneChaine, 1) = "C" Then groupe = 150
If Mid$(UneChaine, 2, 1) = "C" Then groupe = groupe + 150
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 300
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 300
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 500
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 400
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 200
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 200
If Mid$(UneChaine, 8, 1) = "B" Then groupe = groupe + 100
'Rang groupe G
If groupe >= 650 Then
Rang = 10: GoTo GIR
Else
Rang = 0
End If
'Teste Une Chaine pour le groupe H
groupe = 0
If Mid$(UneChaine, 3, 1) = "C" Then groupe = groupe + 3000
If Mid$(UneChaine, 4, 1) = "C" Then groupe = groupe + 3000
If Mid$(UneChaine, 5, 1) = "C" Then groupe = groupe + 3000
If Mid$(UneChaine, 6, 1) = "C" Then groupe = groupe + 3000
If Mid$(UneChaine, 7, 1) = "C" Then groupe = groupe + 1000
If Mid$(UneChaine, 8, 1) = "C" Then groupe = groupe + 1000
If Mid$(UneChaine, 3, 1) = "B" Then groupe = groupe + 2000
If Mid$(UneChaine, 4, 1) = "B" Then groupe = groupe + 2000
If Mid$(UneChaine, 5, 1) = "B" Then groupe = groupe + 2000
If Mid$(UneChaine, 6, 1) = "B" Then groupe = groupe + 2000
If Mid$(UneChaine, 7, 1) = "B" Then groupe = groupe + 2000
If Mid$(UneChaine, 8, 1) = "B" Then groupe = groupe + 1000
'Rang groupe H
Select Case groupe
Case Is >= 4000
Rang = 11
Case 2000 To 3999
Rang = 12
Case Is < 2000
Rang = 13
End Select
GoTo GIR
GIR:
Select Case Rang
Case Is = 1
GIR = 1
Case 2 To 7
GIR = 2
Case 8 To 9
GIR = 3
Case 10 To 11
GIR = 4
Case 12
GIR = 5
Case 13
GIR = 6
End Select
End Function
| Retour |
![]() |