Appliquer un commentaire
Catégorie : Commentaires
Publié par veriland le 11-Aug-2013 16:00

Code à placer dans un module

Option Explicit
Sub commentaire()
' Ti'
Dim i As Integer
For i = 1 To Range("E65535").End(xlUp).Row
If Range("E" & i).Value <> "" Then
With Range("D" & i)
.ClearComments
.AddComment
.Comment.Visible = True
.Comment.Text Text:=Range("E" & i).Value
With .Comment.Shape
.TextFrame.AutoSize = True
.Fill.ForeColor.RGB = RGB(255, 0, 0)
.Fill.Transparency = 0#
.IncrementLeft -100
With .OLEFormat.Object
With .Font
.Name = "Arial"
.Size = 12
.ColorIndex = 6
.Bold = True
End With
End With
End With
End With
Else
Range("D" & i).ClearComments
End If
Next i
End Sub