Modifier Commentaires via VBA

Startus

XLDnaute Occasionnel
Bonjour le forum,

Je n'arrive pas à modifier l'ensemble des commentaires sur une de mes feuilles...

Code:
Sub ModComt ()
Dim Cellule as Comments
For each Cellule in Selection
    With Selection.Font
        .Name = 'Tahoma'
        .FontStyle = 'Gras'
        .Size = 10
End With
  With Selection
        .HorizontalAlignment = xlCenter
        .VerticalAlignment = xlCenter
        .ReadingOrder = xlContext
        .Orientation = xlHorizontal
    End With
    Selection.ShapeRange.Fill.Visible = msoTrue
    Selection.ShapeRange.Fill.Solid
    Selection.ShapeRange.Fill.ForeColor.SchemeColor = 22
    Selection.ShapeRange.Fill.Transparency = 0.5
    Selection.ShapeRange.Line.Weight = 0.75
    Selection.ShapeRange.Line.DashStyle = msoLineSolid
    Selection.ShapeRange.Line.Style = msoLineSingle
    Selection.ShapeRange.Line.Transparency = 0#
    Selection.ShapeRange.Line.Visible = msoFalse
    Selection.ShapeRange.ScaleHeight 0.53, msoFalse, msoScaleFromTopLeft
    Range('A1').Select
Next
End Sub

Malheureusement, ceci ne marche pas
Merci
 

Creepy

XLDnaute Accro
hello all,

Je ne comprends pas grand chose à ton post, peux-tu être plus claire.

IDEALEMENT : Mettre un petit exemple en ZIP <50Ko

Bizarre, j'ai une impression de deja 'ecrit'

++

Creepy

PS : Déjà, une petite remarque pour optimiser ton code :

With Selection.ShapeRange.fill
.Visible = msoTrue
.Solid
.ForeColor.SchemeColor = 22
.Transparency = 0.5
end with
With Selection.ShapeRange.line
.Weight = 0.75
.DashStyle = msoLineSolid
.Style = msoLineSingle
.Transparency = 0#
.Visible = msoFalse
end with

Selection.ShapeRange.ScaleHeight 0.53, msoFalse, msoScaleFromTopLeft
 

Startus

XLDnaute Occasionnel
Bonjour,

Il est vrai que je n'ai pas été très clair, je reformule...

En fait, je voudrais qu'une macro me modifie tous les commentaires d'une feuille dans un format d'un commentaire Type

Voila le fichier, qui montre ce que je veut...

Est-il possible également qu'un bouton m'ajoute à chaque clic dessus, un commentaire du type prédéfinie dans la cellule sélectionnée ?

Merci, pour vos remarque et votre aide
Startus
 

Membres actuellement en ligne

Statistiques des forums

Discussions
312 321
Messages
2 087 265
Membres
103 501
dernier inscrit
talebafia