format text commentaire

jean paul

XLDnaute Junior
bonsoir à tous

J'utilise ce code dérivé d'un exemple de l'excellent Boisgonthier pour mettre à jour des commentaires ,j'insère une photo +le texte des 4 cellules adjacentes dans le commentaire ,mais pour une meilleur lisibilité du texte sur la photo je souhaite avoir une police bleu de taille 12,jai bien essayé divers code sans résultat
merci de vos réponses
cordialement JP
Sub Trombine()
Dim x
Dim xx
Dim xxx
Dim xxxx
Dim y
Dim c
For Each c In Range("A2", [A65000].End(xlUp))
x = c.Offset(0, 1)
xx = c.Offset(0, 2)
xxx = c.Offset(0, 3)
xxxx = c.Offset(0, 4)
y = c.Offset(0, 5)


repertoire = ThisWorkbook.Path & "\"

c.ClearComments
c.AddComment
c.Comment.Text Text:="" & [x] & Chr(10) & [xx] & Chr(10) & [xxx] & Chr(10) & [xxxx] & Chr(10) & [y] & " "
fichier = CStr(c.Value) & ".jpg"
If Dir(repertoire & fichier) <> "" Then
c.Comment.Shape.Fill.UserPicture repertoire & fichier

c.Comment.Shape.ScaleHeight 2, msoFalse, msoScaleFromTopLeft
c.Comment.Shape.ScaleWidth 3, msoFalse, msoScaleFromTopLeft


End If
Next

End Sub
 

Pièces jointes

  • Copie de SurvolArticles2.xls
    41.5 KB · Affichages: 71

Catrice

XLDnaute Barbatruc
Re : format text commentaire

Bonsoir,

Tu peux essayer ceci :

.....
c.Comment.Text Text:="" & [x] & Chr(10) & [xx] & Chr(10) & [xxx] & Chr(10) & [xxxx] & Chr(10) & [y] & " "
c.Comment.Shape.TextFrame.Characters.Font.Size = 12
c.Comment.Shape.TextFrame.Characters.Font.ColorIndex = 5

fichier = CStr(c.Value) & ".jpg"
.....
 

Statistiques des forums

Discussions
312 687
Messages
2 090 955
Membres
104 705
dernier inscrit
Mike72