bonjour yan voici ce qu'écrivit un lointain mais non moins émérite contributeur :
Sub changeCommentFont() For Each cmt In ActiveSheet.Comments With cmt.Shape.TextFrame.Characters.Font .Name = "Arial" .Italic = True .Size = 9 End With Next End Sub
HTH jps
"yan" a écrit dans le message de news: 454e389f$0$5110$
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
bonjour yan
voici ce qu'écrivit un lointain mais non moins émérite contributeur :
Sub changeCommentFont()
For Each cmt In ActiveSheet.Comments
With cmt.Shape.TextFrame.Characters.Font
.Name = "Arial"
.Italic = True
.Size = 9
End With
Next
End Sub
HTH
jps
"yan" <xyz@wanadoo.fr> a écrit dans le message de news:
454e389f$0$5110$ba4acef3@news.orange.fr...
bonjour à tous
Est-il possible par vba de modifier la police du texte d'un commentaire
(gras, italique, couleur.....)
Merci
A+
Yan
bonjour yan voici ce qu'écrivit un lointain mais non moins émérite contributeur :
Sub changeCommentFont() For Each cmt In ActiveSheet.Comments With cmt.Shape.TextFrame.Characters.Font .Name = "Arial" .Italic = True .Size = 9 End With Next End Sub
HTH jps
"yan" a écrit dans le message de news: 454e389f$0$5110$
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
MichDenis
Cette procédure modifie le caractère gras et italique que pour le mot "Tout" du commentaire '----------------------- Sub test()
Dim Sh As Shape With Feuil1.Range("e5").Comment .Text "Bonjour tout le monde" With .Shape With .TextFrame.Characters(9, 4) .Font.Bold = True .Font.Italic = True End With End With End With End Sub '-----------------------
Si on désire modifier le format pour tout le commentaire : '---------------------- Sub test()
With Feuil1.Range("e5").Comment.Shape.OLEFormat.Object .Font.Name = "Arial" .Font.Bold = True .Font.Italic = True End With
End Sub '----------------------
"yan" a écrit dans le message de news: 454e389f$0$5110$ bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
Cette procédure modifie le caractère gras et italique que pour le mot "Tout" du commentaire
'-----------------------
Sub test()
Dim Sh As Shape
With Feuil1.Range("e5").Comment
.Text "Bonjour tout le monde"
With .Shape
With .TextFrame.Characters(9, 4)
.Font.Bold = True
.Font.Italic = True
End With
End With
End With
End Sub
'-----------------------
Si on désire modifier le format pour tout le commentaire :
'----------------------
Sub test()
With Feuil1.Range("e5").Comment.Shape.OLEFormat.Object
.Font.Name = "Arial"
.Font.Bold = True
.Font.Italic = True
End With
End Sub
'----------------------
"yan" <xyz@wanadoo.fr> a écrit dans le message de news: 454e389f$0$5110$ba4acef3@news.orange.fr...
bonjour à tous
Est-il possible par vba de modifier la police du texte d'un commentaire
(gras, italique, couleur.....)
Merci
A+
Yan
Cette procédure modifie le caractère gras et italique que pour le mot "Tout" du commentaire '----------------------- Sub test()
Dim Sh As Shape With Feuil1.Range("e5").Comment .Text "Bonjour tout le monde" With .Shape With .TextFrame.Characters(9, 4) .Font.Bold = True .Font.Italic = True End With End With End With End Sub '-----------------------
Si on désire modifier le format pour tout le commentaire : '---------------------- Sub test()
With Feuil1.Range("e5").Comment.Shape.OLEFormat.Object .Font.Name = "Arial" .Font.Bold = True .Font.Italic = True End With
End Sub '----------------------
"yan" a écrit dans le message de news: 454e389f$0$5110$ bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
JB
Bonsoir,
Modifie la totalité du commentaire:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font .Name = "Tverdana" .Size = 8 .FontStyle = "Normal" .ColorIndex = 3 End With
SendKeys "m" Else SendKeys "m" End If End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text) With Target.Comment.Shape.TextFrame .Characters(Start:=1, Length:=lg).Font.Name = "Verdana" .Characters(Start:=1, Length:=lg).Font.Size = 8 .Characters(Start:=1, Length:=lg).Font.Bold = True .Characters(Start:=1, Length:=lg).Font.Italic = True .Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:™).Font.Bold = False .Characters(Start:=lg, Length:™).Font.Italic = False .Characters(Start:=lg, Length:™).Font.ColorIndex = 1 End With SendKeys "m" Else SendKeys "m" End If End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
Bonsoir,
Modifie la totalité du commentaire:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.NoteText = "" Then
Target.AddComment
Target.Comment.Text Text:=CStr(Now) & Chr(10) &
Environ("username") & Chr(10)
lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font
.Name = "Tverdana"
.Size = 8
.FontStyle = "Normal"
.ColorIndex = 3
End With
SendKeys "m"
Else
SendKeys "m"
End If
End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.NoteText = "" Then
Target.AddComment
Target.Comment.Text Text:=CStr(Now) & Chr(10) &
Environ("username") & Chr(10)
lg = Len(Target.Comment.Text)
With Target.Comment.Shape.TextFrame
.Characters(Start:=1, Length:=lg).Font.Name = "Verdana"
.Characters(Start:=1, Length:=lg).Font.Size = 8
.Characters(Start:=1, Length:=lg).Font.Bold = True
.Characters(Start:=1, Length:=lg).Font.Italic = True
.Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:=99).Font.Bold = False
.Characters(Start:=lg, Length:=99).Font.Italic = False
.Characters(Start:=lg, Length:=99).Font.ColorIndex = 1
End With
SendKeys "m"
Else
SendKeys "m"
End If
End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous
Est-il possible par vba de modifier la police du texte d'un commentaire
(gras, italique, couleur.....)
Merci
A+
Yan
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font .Name = "Tverdana" .Size = 8 .FontStyle = "Normal" .ColorIndex = 3 End With
SendKeys "m" Else SendKeys "m" End If End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text) With Target.Comment.Shape.TextFrame .Characters(Start:=1, Length:=lg).Font.Name = "Verdana" .Characters(Start:=1, Length:=lg).Font.Size = 8 .Characters(Start:=1, Length:=lg).Font.Bold = True .Characters(Start:=1, Length:=lg).Font.Italic = True .Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:™).Font.Bold = False .Characters(Start:=lg, Length:™).Font.Italic = False .Characters(Start:=lg, Length:™).Font.ColorIndex = 1 End With SendKeys "m" Else SendKeys "m" End If End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
MichDenis
| If ActiveCell.NoteText = "" Then | Target.AddComment
Si comme tu l'as écrit, si le commentaire n'a aucun text, (y compris un espace provenant de la barre d'espacement) Target.AddComment va se planter ....
Si par ce test, tu voulais tester la présence d'un commentaire pour la cellule active... ce n'est pas une méthode efficace pour arriver à cette fin.
"JB" a écrit dans le message de news:
Bonsoir,
Modifie la totalité du commentaire:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font .Name = "Tverdana" .Size = 8 .FontStyle = "Normal" .ColorIndex = 3 End With
SendKeys "m" Else SendKeys "m" End If End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text) With Target.Comment.Shape.TextFrame .Characters(Start:=1, Length:=lg).Font.Name = "Verdana" .Characters(Start:=1, Length:=lg).Font.Size = 8 .Characters(Start:=1, Length:=lg).Font.Bold = True .Characters(Start:=1, Length:=lg).Font.Italic = True .Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:™).Font.Bold = False .Characters(Start:=lg, Length:™).Font.Italic = False .Characters(Start:=lg, Length:™).Font.ColorIndex = 1 End With SendKeys "m" Else SendKeys "m" End If End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
| If ActiveCell.NoteText = "" Then
| Target.AddComment
Si comme tu l'as écrit, si le commentaire n'a aucun text,
(y compris un espace provenant de la barre d'espacement)
Target.AddComment va se planter ....
Si par ce test, tu voulais tester la présence d'un commentaire
pour la cellule active... ce n'est pas une méthode efficace pour
arriver à cette fin.
"JB" <boisgontier@hotmail.com> a écrit dans le message de news:
1162763050.277094.149390@f16g2000cwb.googlegroups.com...
Bonsoir,
Modifie la totalité du commentaire:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.NoteText = "" Then
Target.AddComment
Target.Comment.Text Text:=CStr(Now) & Chr(10) &
Environ("username") & Chr(10)
lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font
.Name = "Tverdana"
.Size = 8
.FontStyle = "Normal"
.ColorIndex = 3
End With
SendKeys "m"
Else
SendKeys "m"
End If
End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
If ActiveCell.NoteText = "" Then
Target.AddComment
Target.Comment.Text Text:=CStr(Now) & Chr(10) &
Environ("username") & Chr(10)
lg = Len(Target.Comment.Text)
With Target.Comment.Shape.TextFrame
.Characters(Start:=1, Length:=lg).Font.Name = "Verdana"
.Characters(Start:=1, Length:=lg).Font.Size = 8
.Characters(Start:=1, Length:=lg).Font.Bold = True
.Characters(Start:=1, Length:=lg).Font.Italic = True
.Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:™).Font.Bold = False
.Characters(Start:=lg, Length:™).Font.Italic = False
.Characters(Start:=lg, Length:™).Font.ColorIndex = 1
End With
SendKeys "m"
Else
SendKeys "m"
End If
End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous
Est-il possible par vba de modifier la police du texte d'un commentaire
(gras, italique, couleur.....)
Merci
A+
Yan
| If ActiveCell.NoteText = "" Then | Target.AddComment
Si comme tu l'as écrit, si le commentaire n'a aucun text, (y compris un espace provenant de la barre d'espacement) Target.AddComment va se planter ....
Si par ce test, tu voulais tester la présence d'un commentaire pour la cellule active... ce n'est pas une méthode efficace pour arriver à cette fin.
"JB" a écrit dans le message de news:
Bonsoir,
Modifie la totalité du commentaire:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text)
With Target.Comment.Shape.OLEFormat.Object.Font .Name = "Tverdana" .Size = 8 .FontStyle = "Normal" .ColorIndex = 3 End With
SendKeys "m" Else SendKeys "m" End If End Sub
Modifie une partie du commentaire seulement:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean) If ActiveCell.NoteText = "" Then Target.AddComment Target.Comment.Text Text:=CStr(Now) & Chr(10) & Environ("username") & Chr(10) lg = Len(Target.Comment.Text) With Target.Comment.Shape.TextFrame .Characters(Start:=1, Length:=lg).Font.Name = "Verdana" .Characters(Start:=1, Length:=lg).Font.Size = 8 .Characters(Start:=1, Length:=lg).Font.Bold = True .Characters(Start:=1, Length:=lg).Font.Italic = True .Characters(Start:=1, Length:=lg).Font.ColorIndex = 3
.Characters(Start:=lg, Length:™).Font.Bold = False .Characters(Start:=lg, Length:™).Font.Italic = False .Characters(Start:=lg, Length:™).Font.ColorIndex = 1 End With SendKeys "m" Else SendKeys "m" End If End Sub
http://cjoint.com/?lfwRpuT2Tp
JB
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
yan
Bonjour Merci a vous 3 J'ai récuperer dans vos examples ce que j'avais besoin ( et que je ne connaissais pas) à une proc en cours ça marche Encore merci bonne journée A+ Yan
"yan" a écrit dans le message de news: 454e389f$0$5110$
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan
Bonjour
Merci a vous 3
J'ai récuperer dans vos examples ce que j'avais besoin ( et que je ne
connaissais pas) à une proc en cours
ça marche
Encore merci
bonne journée
A+
Yan
"yan" <xyz@wanadoo.fr> a écrit dans le message de news:
454e389f$0$5110$ba4acef3@news.orange.fr...
bonjour à tous
Est-il possible par vba de modifier la police du texte d'un commentaire
(gras, italique, couleur.....)
Merci
A+
Yan
Bonjour Merci a vous 3 J'ai récuperer dans vos examples ce que j'avais besoin ( et que je ne connaissais pas) à une proc en cours ça marche Encore merci bonne journée A+ Yan
"yan" a écrit dans le message de news: 454e389f$0$5110$
bonjour à tous Est-il possible par vba de modifier la police du texte d'un commentaire (gras, italique, couleur.....) Merci A+ Yan