Sub Verification()
Dim plage As Range, nlig&, ncol%, tablo, col%, a(), n%, i&, j%, x$, b()
Set plage = ActiveSheet.Range("A1", ActiveSheet.UsedRange)
nlig = plage.Rows.Count
ncol = plage.Columns.Count
If ncol = 1 Then ncol = 2
tablo = plage.Resize(, ncol) 'matrice, plus rapide
For col = 2 To ncol Step 2
Select Case Weekday(tablo(2, col), 2)
Case 1
ReDim a(1 To 2 * nlig, 1 To 1)
n = 0
For i = 4 To nlig
For j = 0 To 1
If tablo(i, col + j) <> "" Then
n = n + 1
a(n, 1) = tablo(i, col + j)
End If
Next j, i
Case 3, 5
ReDim Preserve a(1 To 2 * nlig, 1 To 1)
ReDim Preserve a(1 To 2 * nlig, 1 To 2)
For i = 4 To nlig
For j = 0 To 1
x = tablo(i, col + j)
If x <> "" Then
For n = 1 To 2 * nlig
If a(n, 1) = x And a(n, 2) = "" Then a(n, 2) = 1: GoTo 2
Next n
1 plage(4, col).Resize(nlig - 3, 2).Select
MsgBox "Codes à revoir dans la plage sélectionnée...": Exit Sub
2 End If
Next j, i
For n = 1 To nlig
If a(n, 1) <> "" Then If a(n, 2) = "" Then GoTo 1
Next n
Case 2
ReDim b(1 To 2 * nlig, 1 To 2)
n = 0
For i = 4 To nlig
For j = 0 To 1
If tablo(i, col + j) <> "" Then
n = n + 1
b(n, 1) = tablo(i, col + j)
End If
Next j, i
Case 4
For i = 4 To nlig
For j = 0 To 1
x = tablo(i, col + j)
If x <> "" Then
For n = 1 To 2 * nlig
If b(n, 1) = x And b(n, 2) = "" Then b(n, 2) = 1: GoTo 3
Next n
GoTo 1
3 End If
Next j, i
For n = 1 To 2 * nlig
If b(n, 1) <> "" Then If b(n, 2) = "" Then GoTo 1
Next n
End Select
Next col
End Sub