Là aussi, une erreur
Application.CountIf(ws_A.Range("A:A"), ws_D.Cells(lig_D, 1).Value)
si vous voulez désigner une plage il faut mettre sous cette forme:
Application.CountIf(ws_A.Range("A1:A1000"), ws_D.Cells(lig_D, 1).Value)
ou
Application.CountIf(ws_D.Columns("A:A"), ws_A.Cells(lig_A, 1).Value)
ou
Application.CountIf(ws_D.Columns(1), ws_A.Cells(lig_A, 1).Value)