Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

supprimer titre d'un commentaire

6 réponses
Avatar
Arnaud Lehéricher
Bonjour je cherche une macro qui m'ajouterai un commentaire à la cellule
selectionnée sans y faire apparaitre le fameux "username" et ayant un texte
en Comic Sans MS 10 normal ?

Si qulqu'un arrive à me la faire ca serait super.....
Ca parait peut etre enfantin pour pas mal d'entre vous mais moi j'galere
depuis 3 h !!!

voici mon ebauche mais je n'arrive pas a supprimer la premiere
ligne....rhooo...grrrr

Merci d'avance

Arnaud ---- avleher@club.fr






Sub Commentaire()
'
' Commentaire Macro
'
' Touche de raccourci du clavier: Ctrl+w
'

For Each i In ActiveSheet.Comments
i.Shape.OLEFormat.Object.Font.Name = "Comic Sans MS"
i.Shape.OLEFormat.Object.Font.Size = 10
i.Shape.TextFrame.Characters(Start:=10, Length:=10).Font.Size = 10
Next i
For Each c In ActiveSheet.Comments
c.Text Text:=Replace(c.Text, "JEANNETEAU:", "")
c.Shape.TextFrame.Characters(Start:=1, Length:=999).Font.Bold = False
Kill Rows(1)
Next c

End Sub

6 réponses

Avatar
Modeste
Bonsour® Arnaud Lehéricher avec ferveur ;o))) vous nous disiez :

Bonjour je cherche une macro qui m'ajouterai un commentaire à la
cellule selectionnée sans y faire apparaitre le fameux "username" et
ayant un texte en Comic Sans MS 10 normal ?



Sub Macro3()
Application.UserName = " "
Range("B5").AddComment
Range("B5").Comment.Text Text:="coucou"
End Sub
Avatar
JB
Bonjour,

Saisie d'un commentaire sans le nom de user sur double-clic:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
If Target.Comment Is Nothing Then
Target.AddComment ' Création commentaire
Target.Comment.Shape.OLEFormat.Object.Font.Name = "Tverdana"
Target.Comment.Shape.OLEFormat.Object.Font.Size = 7
Target.Comment.Shape.OLEFormat.Object.Font.FontStyle = "Normal"
SendKeys "+{F2}"
Cancel = True
End If
End Sub

http://boisgontierjacques.free.fr/fichiers/Commentaires/CommentaireSansNomU ser.xls

JB
http://boisgontierjacques.free.fr/


On 12 déc, 01:11, "Arnaud Lehéricher"
internet.fr> wrote:
Bonjour je cherche une macro qui m'ajouterai un commentaire à la cellul e
selectionnée sans y faire apparaitre le fameux "username" et ayant un t exte
en Comic Sans MS 10 normal ?

Si qulqu'un arrive à me la faire ca serait super.....
Ca parait peut etre enfantin pour pas mal d'entre vous mais moi j'galere
depuis 3 h !!!

voici mon ebauche mais je n'arrive pas a supprimer la premiere
ligne....rhooo...grrrr

Merci d'avance

Arnaud  ----

Sub Commentaire()
'
' Commentaire Macro
'
' Touche de raccourci du clavier: Ctrl+w
'

  For Each i In ActiveSheet.Comments
    i.Shape.OLEFormat.Object.Font.Name = "Comic Sans MS"
    i.Shape.OLEFormat.Object.Font.Size = 10
    i.Shape.TextFrame.Characters(Start:, Length:).Font.Size = 10
  Next i
  For Each c In ActiveSheet.Comments
    c.Text Text:=Replace(c.Text, "JEANNETEAU:", "")
    c.Shape.TextFrame.Characters(Start:=1, Length:™9).Font.Bold = False
    Kill Rows(1)
    Next c

End Sub


Avatar
Daniel.j
bonjour
En complement des reponses deja faites
cette macro qui supprime le "Username" des commentaires de la feuille

Sub SupNomAuthor()
Dim NomAuthor As String
Dim TxtComment As String
Dim Commentaire As Comment

'Recupere le nom utilisateur
NomAuthor = ActiveWorkbook.BuiltinDocumentProperties(3)

For Each Commentaire In ActiveSheet.Comments
TxtComment = Commentaire.Text
If Left(TxtComment, Len(NomAuthor)) = NomAuthor Then
'+2 pour virer les 2 points ":"
TxtComment = Mid(TxtComment, Len(NomAuthor) + 2)
'Chr(10) pour virer la ligne vide
'la fonction Chr(10) renvoie un caractère de saut de ligne.
If Left(TxtComment, 1) = Chr(10) Then
TxtComment = Mid(TxtComment, 3)
End If
End If
Commentaire.Text Text:=TxtComment
Next Commentaire
End Sub
Daniel

--
FAQ MPFE
http://dj.joss.free.fr/faq.htm

"Arnaud Lehéricher" a écrit dans le
message de news: Oo36s6%
Bonjour je cherche une macro qui m'ajouterai un commentaire à la cellule
selectionnée sans y faire apparaitre le fameux "username" et ayant un
texte en Comic Sans MS 10 normal ?

Si qulqu'un arrive à me la faire ca serait super.....
Ca parait peut etre enfantin pour pas mal d'entre vous mais moi j'galere
depuis 3 h !!!

voici mon ebauche mais je n'arrive pas a supprimer la premiere
ligne....rhooo...grrrr

Merci d'avance

Arnaud ----






Sub Commentaire()
'
' Commentaire Macro
'
' Touche de raccourci du clavier: Ctrl+w
'

For Each i In ActiveSheet.Comments
i.Shape.OLEFormat.Object.Font.Name = "Comic Sans MS"
i.Shape.OLEFormat.Object.Font.Size = 10
i.Shape.TextFrame.Characters(Start:, Length:).Font.Size = 10
Next i
For Each c In ActiveSheet.Comments
c.Text Text:=Replace(c.Text, "JEANNETEAU:", "")
c.Shape.TextFrame.Characters(Start:=1, Length:™9).Font.Bold = False
Kill Rows(1)
Next c

End Sub



Avatar
LSteph
Bonsoir,

et le bon username va-t-il revenir ensuite pour ce à quoi sert?
;-)

Cordialement.

--
lSteph


Modeste a écrit :
Bonsour® Arnaud Lehéricher avec ferveur ;o))) vous nous disiez :

Bonjour je cherche une macro qui m'ajouterai un commentaire à la
cellule selectionnée sans y faire apparaitre le fameux "username" et
ayant un texte en Comic Sans MS 10 normal ?



Sub Macro3()
Application.UserName = " "
Range("B5").AddComment
Range("B5").Comment.Text Text:="coucou"
End Sub




Avatar
Modeste
Bonsour® LSteph avec ferveur ;o))) vous nous disiez :

et le bon username va-t-il revenir ensuite pour ce à quoi sert?
;-)



pfff...
tu le memorises en début de macro,
tu le remets en place à la fin

pour avoir le bon ???:
Application.UserName = "" au lieu de Application.UserName = " "
Avatar
michdenis
Ta macro proposée pourrait se résumer à ceci et
ce serait suffisant.

'-----------------------------
Sub Macro3()
Range("B5").AddComment "coucou"
End sub
'-----------------------------


"Modeste" a écrit dans le message de news:

Bonsour® LSteph avec ferveur ;o))) vous nous disiez :

et le bon username va-t-il revenir ensuite pour ce à quoi sert?
;-)



pfff...
tu le memorises en début de macro,
tu le remets en place à la fin

pour avoir le bon ???:
Application.UserName = "" au lieu de Application.UserName = " "