anthoYS
XLDnaute Barbatruc
bonjour,
dans le présent code* nous pouvons juste ajouter un commentaire par clic droit que dans certaines colonnes, or je souhaite cela sur beaucoup plus de colonne, admettons A:ZZS
comment procéder sans le faire un à un à la manière du code ?
merci
à+
*
dans le présent code* nous pouvons juste ajouter un commentaire par clic droit que dans certaines colonnes, or je souhaite cela sur beaucoup plus de colonne, admettons A:ZZS
comment procéder sans le faire un à un à la manière du code ?
merci
à+
*
Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Set Target = ActiveCell
Cancel = True
With Target
If .Column = 9 Then
Cancel = True
If .Comment Is Nothing Then
.AddComment
.Comment.Shape.Width = 50.5
.Comment.Shape.Height = 10.75
End If
SendKeys "%im"
End If
If .Column = 8 Then
Cancel = True
If .Comment Is Nothing Then
.AddComment
.Comment.Shape.Width = 110.5
.Comment.Shape.Height = 15.75
End If
SendKeys "%im"
End If
If .Column = 7 Then
Cancel = True
If .Comment Is Nothing Then
.AddComment
.Comment.Shape.Width = 130.5
.Comment.Shape.Height = 19.75
End If
SendKeys "%im"
End If
If .Column = 10 Then
Cancel = True
If .Comment Is Nothing Then
.AddComment
.Comment.Shape.Width = 170.5
.Comment.Shape.Height = 38.75
End If
SendKeys "%im"
End If
If .Column = 20 Then
Cancel = True
If .Comment Is Nothing Then
.AddComment
.Comment.Shape.Width = 360.5
.Comment.Shape.Height = 200.75
End If
SendKeys "%im"
End If
End With
End Sub