bonjour,
si j'ai bien compris ce que tu cherches à obtenir comme résultat
Private Sub CommandButton1_Click()
Call rectangle
Cells(2, 1) = 1
End Sub
Private Sub CommandButton2_Click()
Call reinitialiser
End Sub
Sub rectangle()
i = 23
found = False
Do While Cells(i, 2) <> ""
If Cells(i, 3) = Cells(7, 2) And Cells(i, 4) = Cells(7, 3) Then
Cells(i, 2) = Cells(i, 2) + 1
found = True
Exit Do
End If
i = i + 1
If i > 30 Then MsgBox "plus de place pour ajouter une plaque": Exit Sub
Loop
If Not found Then
Cells(i, 2) = 1
Cells(i, 3) = Cells(7, 2)
Cells(i, 4) = Cells(7, 3)
End If
End Sub
Sub reinitialiser()
Range("B23:d30").Select
Selection.ClearContents
End Sub