Option Explicit
Dim vx%, lig&
Private Sub groupe()
Dim chn$
Select Case vx
'groupe à 1 départ ok
Case 97: chn = "05"
Case 20: chn = "06"
Case 98: chn = "22"
'groupe à 2 départ ok
Case 73, 74: chn = "11"
Case 27, 59, 62, 76: chn = "14"
'groupe à 3 départ OK
Case 32, 46, 47: chn = "01"
Case 2, 60, 80: chn = "03"
Case 16, 24, 33: chn = "08"
Case 18, 36, 58: chn = "09"
Case 14, 50, 61: chn = "10"
Case 57, 67, 68: chn = "12"
Case 21, 52, 71: chn = "13"
Case 5, 26, 38: chn = "16"
Case 19, 23, 87: chn = "17"
Case 1, 42, 69: chn = "18"
Case 54, 55, 88: chn = "20"
Case 4, 37, 45: chn = "23"
Case 75, 93, 94: chn = "24"
Case 77, 89, 91: chn = "25"
Case 40, 64, 65: chn = "26"
Case 8, 10, 51: chn = "28"
'groupe à 4 départ OK
Case 6, 13, 41, 83: chn = "02"
Case 25, 39, 70, 90: chn = "07"
Case 11, 12, 34, 72: chn = "19"
Case 7, 30, 48, 84: chn = "21"
Case 17, 79, 85, 86: chn = "27"
Case 3, 15, 43, 63: chn = "30"
Case 9, 31, 81, 82: chn = "33"
Case 28, 78, 92, 95: chn = "34"
'groupe à 5 départ ok
Case 22, 29, 35, 44, 56: chn = "29"
End Select
Cells(lig, 10).Value = "GG" & chn
End Sub
Private Sub agence()
Dim T, i%: T = Array(7, 9, 11, 12, 30, 31, 32, 34, 46, 48, 65, 66, 81, 82, 84)
For i = 0 To UBound(T)
If vx = T(i) Then Cells(lig, 11) = 1: Cells(lig, 12) = "MDO": Exit For
Next i
End Sub
Private Sub analyste()
Dim ag$: ag = Left$(Cells(lig, 11), 2)
Cells(lig, 12) = IIf(ag = "" And vx < 57, "SRI", "KBO")
End Sub
Sub lance()
If ActiveSheet.Name <> "copie" Then Exit Sub
Dim dlg&: dlg = Cells(Rows.Count, 3).End(3).Row: If dlg = 1 Then Exit Sub
Dim dpt As String * 5: Application.ScreenUpdating = 0
Range("J2:L" & dlg).ClearContents
For lig = 2 To dlg
With Cells(lig, 3)
dpt = .Text: vx = Val(Mid$(dpt, 2, 2)): groupe
vx = Val(Left$(dpt, 2)): agence: analyste
End With
Next lig
End Sub