bonjour,
je crois que je n'avais pas compris ta demande initiale. Tu demandes donc comment résoudre l'erreur que tu reçois pour une macro bien précise
voici
Sub CountQuartiles()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Feuil1") ' Change to your sheet name
Dim rng As Range
Set rng = ws.Range("A1:A100") ' Change to your data range
Dim data As Variant
data = rng.Value
Dim n As Long
n = UBound(data)
' Sort the data
Call BubbleSort(data, n)
End Sub
' Bubble sort function
Sub BubbleSort(arr As Variant, ByVal n As Long)
Dim i As Long, j As Long
Dim temp As Variant
For i = 1 To n - 1
For j = i + 1 To n
If arr(i, 1) > arr(j, 1) Then
temp = arr(i, 1)
arr(i, 1) = arr(j, 1)
arr(j, 1) = temp
End If
Next j
Next i
End Sub
cette macro fait un tri mais n'affiche pas le résultat !