mettre tous les commentaire à la même dimension

thum

XLDnaute Nouveau
Bjr à tous,
dans ma feuille j'ai fait des commentaires sous forme d'image,mais voilà ,je voudrais que toutes les image soient à la même dimension , soi 14.5 x 9.5 cm (il y en a 185),j'ai trouvai ce code, mais elles sont toutes petite.
VB:
Sub AutoSizeComment()
Dim xwk, xcomment
  On Error Resume Next
  For Each xwk In ThisWorkbook.Worksheets
    For Each xcomment In xwk.Comments
      xcomment.Shape.TextFrame.AutoSize = True
    Next xcomment
  Next xwk
  On Error GoTo 0
End Sub
je n'y connait rien en programation,mais avec ce code peut-on y ajouter les dimensions.
Merci beaucoup de votre aide et d'avance merci
Portez vous bien
 

AtTheOne

XLDnaute Accro
Supporter XLD
Bonjour @thum, bonjour le forum

Ce code devrait fonctionner

VB:
Sub AutoSizeComment()
Dim xwk As Worksheet, xcomment As Comment
  On Error Resume Next
  For Each xwk In ThisWorkbook.Worksheets
    For Each xcomment In xwk.Comments
      xcomment.Shape.Height = Application.CentimetersToPoints(14.5)
      xcomment.Shape.Width = Application.CentimetersToPoints(9.5)   
    Next xcomment
  Next xwk
  On Error GoTo 0
End Sub

Bon courage
Cordialement
Alain
 

Discussions similaires

Réponses
19
Affichages
2 K

Statistiques des forums

Discussions
312 428
Messages
2 088 347
Membres
103 821
dernier inscrit
Lorient56