1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Sub calculs()
Dim i As Integer, j As Integer, fin_plage As Integer
'copie des lignes
For i = 2 To 6
Cells(6, i).Value = Cells(2, i).Value
Next i
' blocage cellules
'Private Sub Worksheet_Change(ByVal Target As Range)
fin_plage = Range("H3").Value + 1
For i = 2 To fin_plage
If Application.CountA(Range(Cells(2, i), Cells(4, i))) > 2 Then
MsgBox "Non !!"
Application.Undo
End If
Next i
For j = 2 To fin_plage
If Application.CountA(Range(Cells(6, j), Cells(10, j))) > 3 Then
MsgBox "Non !!"
Application.Undo
End If
Next j
End Sub |