Sub MAPROCEDURE(valeurs)
'on affecte une valeur de point venant des textbox du userform2
Dim fligne, n, m, x, temp1, temp2, temp3, temp4
Dim liste As Collection
'Dim Valeurs(1 To 10)
'Dim iiii As Integer
'fligne = Range("B6").End(xlDown).Row + 1 'lit les pronos
'Range("B" & fligne & ":IV" & fligne + 6).ClearContents
'les valeurs sont à recuperer dans le userform2 à partir des textbox
'valeurs = Sheets("liste").Range("G2:G11") 'les valeurs des points affdecte aux positions a faire le transfert des textboxe
Set liste = New Collection
For n = 6 To Sheets("synthese").Range("B65536").End(xlUp).Row
For m = 2 To Cells(n, 256).End(xlToLeft).Column
On Error Resume Next
liste.Add Cells(n, m), CStr(Cells(n, m))
On Error GoTo 0
Next m
Next n
'ligne = Range("B65536").End(xlUp).Row + 3
Dim tablo()
ReDim tablo(liste.Count, 4)
For n = 1 To liste.Count
tablo(n, 1) = liste(n)
Next n
For n = 6 To Sheets("synthese").Range("B65536").End(xlUp).Row
For m = 2 To Cells(n, 256).End(xlToLeft).Column
For x = 1 To liste.Count
If tablo(x, 1) = Cells(n, m) Then
tablo(x, 2) = tablo(x, 2) + 1
tablo(x, 3) = tablo(x, 3) & CStr(m - 1) & " "
tablo(x, 4) = tablo(x, 4) + valeurs(m - 1) 'valeurs(m - 1, 1)
End If
Next x
Next m
Next n
For n = 1 To liste.Count
For m = n + 1 To liste.Count
If tablo(n, 4) < tablo(m, 4) Then
temp1 = tablo(n, 1)
temp2 = tablo(n, 2)
temp3 = tablo(n, 3)
temp4 = tablo(n, 4)
tablo(n, 2) = tablo(m, 2)
tablo(n, 1) = tablo(m, 1)
tablo(n, 3) = tablo(m, 3)
tablo(n, 4) = tablo(m, 4)
tablo(m, 2) = temp2
tablo(m, 1) = temp1
tablo(m, 3) = temp3
tablo(m, 4) = temp4
End If
Next m
Next n
'ligne = Range("B65536").End(xlUp).Row + 3
For n = 1 To liste.Count
Sheets("synthese").Cells(2, 1 + n) = tablo(n, 1) 'affiche les chx retenus par la sythese dans la feuille synthese
'Cells(ligne + 1, 1 + n) = tablo(n, 2)
'Cells(ligne + 2, 1 + n) = tablo(n, 3)
'Cells(ligne + 3, 1 + n) = tablo(n, 4) 'affiche les point obtenus par les chx
Next n
'recopie le resultat de la synthese de la feuille "synthese" dans la feuille resultat à partie de F à U , nombre classe du plus petit au plus grand
Sheets("résultat").Range("F" & ir & ":U" & ir).Value = Sheets("synthese").Range("B2:T2").Value
Sheets("résultat").Range("A" & ir).Value = indexcourse '
End Sub