Comment trouver le code qui dit, de la colonne 1 à 15, insérer un commentaire par double clic ? [rés

anthoYS

XLDnaute Barbatruc
Bonjour,


j'ai tout dit.

dans le présent code, ça ne marche que en colonne 1 et 15, là je n'ai ni 2 jusqu'à 14 inclus, or je ne veux pas mettre 2, 3 jusqu'à 14 ! c'est fastidieux, il doit y avoir plus simple...


VB:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
With Target
    If .Column = 1 Then
        Cancel = True
        If .Comment Is Nothing Then
            .AddComment
            .Comment.Shape.Width = 104.5
            .Comment.Shape.Height = 22.6
            .Comment.Shape.TextFrame.Characters.Font.Bold = True
        End If
        SendKeys "%im"
    End If
End With
With Target
    If .Column = 15 Then
        Cancel = True
        If .Comment Is Nothing Then
            .AddComment
            .Comment.Shape.Width = 60.5
            .Comment.Shape.Height = 18.5
            .Comment.Shape.TextFrame.Characters.Font.Bold = True
        End If
        SendKeys "%im"
    End If
End With
If Not Application.Intersect(Target, Range("B:B")) Is Nothing And IsEmpty(Target) Then
Calendrier.Show
End If
Cancel = True
If Not Application.Intersect(Target, Range("F:F")) Is Nothing And IsEmpty(Target) Then
Calendrier.Show
End If
Cancel = True
End Sub


Merci
sinon je chercherai plus tard...
Cordialement ;)
 

Discussions similaires

Membres actuellement en ligne

Aucun membre en ligne actuellement.

Statistiques des forums

Discussions
312 086
Messages
2 085 197
Membres
102 814
dernier inscrit
JLGalley