Salut Stat,
Salut l'équipe,
je n'avais pas (encore!) fait attention à la deuxième feuille!
Je l'ai renommée 'GRAPH', y affiche le résumé des résultats par pays et y ai ajouté une MFC pour souligner les valeurs "inférieure" en [E].
Toujours un double-clic pour démarrer la macro en feuille 'Test...'.
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'
Dim tData, tExtract, tData1(), tData2()
Dim iIdx%
'
Cancel = True
Application.ScreenUpdating = False
'
tData = Range("E1:H" & Range("E" & Rows.Count).End(xlUp).Row + 1).Value
Range("I2:P" & Range("E" & Rows.Count).End(xlUp).Row).ClearContents
tExtract = Range("I1:P" & Range("E" & Rows.Count).End(xlUp).Row + 1).Value
'
For x = 2 To UBound(tData, 1)
If tData(x, 1) <> tData(x - 1, 1) Then
If lStart > 0 Then
iIdx = iIdx + 1
tExtract(lStart, 1) = lTotal / (x - lStart)
tExtract(lStart, 2) = "=QUARTILE(H" & lStart & ":H" & x - 1 & ";4)"
tExtract(lStart, 3) = "=QUARTILE(H" & lStart & ":H" & x - 1 & ";0)"
tExtract(lStart, 4) = "=MEDIANE(H" & lStart & ":H" & x - 1 & ")"
tExtract(lStart, 5) = IIf(x - lStart = 1, "=" & tData(x - 1, 4), "=MODE(H" & lStart & ":H" & x - 1 & ")")
tExtract(lStart, 6) = "=QUARTILE(H" & lStart & ":H" & x - 1 & ";1)"
tExtract(lStart, 7) = "=QUARTILE(H" & lStart & ":H" & x - 1 & ";2)"
tExtract(lStart, 8) = "=QUARTILE(H" & lStart & ":H" & x - 1 & ";3)"
lTotal = 0
End If
lStart = x
End If
lTotal = lTotal + tData(x, 4)
Next
Range("I1:P" & UBound(tExtract, 1)).FormulaLocal = tExtract
tData = Range("E2:P" & Range("I" & Rows.Count).End(xlUp).Row).Value
'
ReDim tData1(iIdx, 4)
ReDim tData2(iIdx, 4)
iIdx = 0
For x = 1 To UBound(tData, 1)
If tData(x, 5) <> "" Then
iIdx = iIdx + 1
For y = 1 To 4
tData1(iIdx - 1, y - 1) = IIf(y = 1, tData(x, 1), tData(x, y + 4))
tData2(iIdx - 1, y - 1) = tData(x, y + 8)
Next
End If
Next
With Worksheets("GRAPH")
.Range("A3").Resize(iIdx, 4).ClearContents
.Range("F3").Resize(iIdx, 4).ClearContents
.Range("A3").Resize(iIdx, 4) = tData1
.Range("F3").Resize(iIdx, 4) = tData2
.Activate
End With
Application.ScreenUpdating = True
'
End Sub
Curieux de connaître le bilan d'un test grandeur nature...
A+
désolée mais je n'arrive pas à l'exécuter j'en ai marre, personne ne sait comment le faire sur le logiciel R sinon par hasard?