Private Declare Function QueryPerformanceCounter Lib "Kernel32" (X As Currency) As Boolean
Private Declare Function QueryPerformanceFrequency Lib "Kernel32" (X As Currency) As Boolean
Sub compter()
Dim plage As Range
Dim n As Long
QueryPerformanceCounter Debut
With Sheets("présence")
Set plage = .Range("Z1:Z" & .[Z65000].End(xlUp).Row)
n = Application.CountIf(plage, .[E1])
End With
QueryPerformanceCounter Fin
QueryPerformanceFrequency Freq
Label41 = n
MsgBox "Durée de la procédure = " & Format(((Fin - Debut) / Freq), "0.00") & " s"
End Sub