Problème macro

isaser -  
m@rina Messages postés 27709 Date d'inscription   Statut Modérateur Dernière intervention   -
Bonjour,

J'aimerai modifier ma macro suivante :

Range("A1").Select
Range("A1").AddComment
Range("A1").Comment.Visible = False
Range("A1").Comment.Text Text:="comptabilite:" & Chr(10) & ""
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 89.25
Selection.ShapeRange.Width = 135.75
End Sub

C'est à dire remplacer ma cellule "A1" par cellule active ou par plusieurs cellules soit "A1 à A10"

Comment faire ?

Isaser

2 réponses

  1. chossette9 Messages postés 6855 Date d'inscription   Statut Contributeur Dernière intervention   1 313
     
    Bonjour,

    pour la cellule active, remplacer A1 par
    ActiveCell
    .

    Pour une plage je sais pas.

    Cordialement.
    0
  2. m@rina Messages postés 27709 Date d'inscription   Statut Modérateur Dernière intervention   11 567
     
    Bonjour,

    Pour la cellule active :

    With ActiveCell.AddComment
        .Text "comptabilite:" & Chr(10) & ""
        .Visible = False
    End With


    Pour une plage de cellule :

    For Each cellule In Range("A1:A10").Cells
        With cellule.AddComment
        .Text "comptabilite:" & Chr(10) & ""
        .Visible = False
        End With
    Next
    --

    m@rina
    - "Sur le forum bureautique, on pose des questions concernant la bureautique..."
    - "Ah bon ???"
    0