Problème macro

isaser -  
m@rina Messages postés 23933 Date d'inscription   Statut Contributeur 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
A voir également:

2 réponses

chossette9 Messages postés 4239 Date d'inscription   Statut Contributeur Dernière intervention   1 311
 
Bonjour,

pour la cellule active, remplacer A1 par
ActiveCell
.

Pour une plage je sais pas.

Cordialement.
0
m@rina Messages postés 23933 Date d'inscription   Statut Contributeur Dernière intervention   11 465
 
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