'Callback for Vérif onAction
Sub Check(control As IRibbonControl)
Dim P As Range, w As Worksheet, i As Variant, j As Variant, test1 As Boolean, test2 As Boolean, mes$, n, s, s1
Set P = Sheets("Accueil").[B:B]
For Each w In Worksheets
i = Application.Match(w.Range("A11"), P, 0) 'adapter au besoin
j = Application.Match("Total", w.Columns("A"), 0)
If IsNumeric(i) And IsNumeric(j) Then
test1 = P(i, 2) = w.Cells(j, 2)
test2 = P(i, 3) = w.Cells(j, 3)
mes = IIf(mes = "", "", mes & vbLf) & w.Name & Chr(9)
If test1 And test2 Then mes = mes & "Vérif Ok": n = n + 1
If Not test1 Then mes = mes & "Erreur sur Année N": n = n + 1
If Not test2 Then mes = mes & IIf(test1, "", vbLf & w.Name & Chr(9)) & "Erreur sur Année N-1": n = n + 1
End If
Next
MsgBox mes
With Sheets("Verif")
. [A:B].ClearContents 'RAZ
If mes = "" Then Exit Sub
s = Split(mes, vbLf)
For i = 1 To n
s1 = Split(s(i - 1), Chr(9))
.Cells(i, 1) = s1(0)
.Cells(i, 2) = s1(1)
Next
End With
End Sub