With Sheets("tableau de bord")
Dim Cel As Range
[COLOR="Red"]For Each Cel In Range("j6:j121;m123:m238;k357:k572")[/COLOR]
With Cel
.ClearComments
If .Value > 0 And .Value <= 50 Then
With .AddComment
.Text Text:="Attention Prevoir vidange dans " & Cel & " heures"
.Visible = True
.Shape.TextFrame.AutoSize = True
End With
ElseIf .Value < 0 Then
With .AddComment
.Text Text:="Attention depassement vidange de " & Cel & " heures"
.Visible = True
With .Shape
.TextFrame.AutoSize = True
With .OLEFormat.Object
With .Font
.Name = "Arial"
.Size = 10
.ColorIndex = 3
.Bold = True
End With
End With
End With
End With
End If
End With
Next Cel
End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowInsertingHyperlinks:=True, AllowSorting:=True, AllowFiltering:= _
True