XL 2016 VBA ajouter commentaire

chifounou

XLDnaute Occasionnel
Bonjour,

J ai enregistré une macro consistant à ajouter un commentaire à une cellule. Voici le code pondu

Range("L11").AddComment
Range("L11").Comment.Visible = False
Range("L11").Comment.Text Text:= _
"* depends :" & Chr(10) & "- yes with old licences acquired before july 16, 2014" & Chr(10) & "- N/A with new licences acquired after july 16, 2014"
Selection.ShapeRange.ScaleWidth 0.97, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.85, msoFalse, msoScaleFromTopLeft

Problème, lorsque j'exécute la macro celà bug à la ligne en gras qui normalement vise à redimensionner la bulle

Autre problème, le texte dans la bulle n'est pas en gras alors qu'il est en gras par défaut au moment où j'enregistre la macro...

Votre aide sera la bienvenue
 

barnes83

XLDnaute Nouveau
Bonjour,

J ai enregistré une macro consistant à ajouter un commentaire à une cellule. Voici le code pondu

Range("L11").AddComment
Range("L11").Comment.Visible = False
Range("L11").Comment.Text Text:= _
"* depends :" & Chr(10) & "- yes with old licences acquired before july 16, 2014" & Chr(10) & "- N/A with new licences acquired after july 16, 2014"
Selection.ShapeRange.ScaleWidth 0.97, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.85, msoFalse, msoScaleFromTopLeft

Problème, lorsque j'exécute la macro celà bug à la ligne en gras qui normalement vise à redimensionner la bulle

Autre problème, le texte dans la bulle n'est pas en gras alors qu'il est en gras par défaut au moment où j'enregistre la macro...

Votre aide sera la bienvenue
 

barnes83

XLDnaute Nouveau
Bonjour,

Range("L11").AddComment
Range("L11").Comment.Visible = False
Range("L11").Comment.Text Text:= _
"* depends :" & Chr(10) & "- yes with old licences acquired before july 16, 2014" & Chr(10) & "- N/A with new licences acquired after july 16, 2014"

Range("C8").Comment.Visible = True ' rendre le commentaire visible
Range("C8").Comment.Shape.Select True 'le selectionner

Selection.ShapeRange.ScaleWidth 0.97, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.85, msoFalse, msoScaleFromTopLeft

Range("L11").Comment.Visible = False

bon courage
cdlt
 

Statistiques des forums

Discussions
312 347
Messages
2 087 501
Membres
103 563
dernier inscrit
samyezzehar