Dim ws As Worksheet
Dim rng As Range
Dim x As Double
Set ws = ActiveWorkbook.Worksheets("2017")
Set rng = ws.Range("AD:AD")
x = WorksheetFunction.CountIf(rng, TextBox20.Value)
If TextBox20 <> "" Then x = WorksheetFunction.CountIf(rng, TextBox20.Value) Else x = 0
MsgBox "Ce nom a déjà été saisi EN 2017 " & x & " fois.", 64, "Attention !..."