Imprime les commentaires ...

Résolu/Fermé
CarineVL Messages postés 122 Date d'inscription samedi 7 novembre 2015 Statut Membre Dernière intervention 3 septembre 2023 - 21 nov. 2015 à 11:40
CarineVL Messages postés 122 Date d'inscription samedi 7 novembre 2015 Statut Membre Dernière intervention 3 septembre 2023 - 22 nov. 2015 à 09:52
Bonjour,
Dans une macro, j'ai défini la zone d'impression du document mais curieusement le document veut imprimer tous les commentaires repris dans cette zone d'impression ...
Comment lui indiquer de n'imprimer que la zone définie sans les commentaires.
Merci ...
CVL

3 réponses

cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
21 nov. 2015 à 17:47
Voir ceci:

http://www.astuceshebdo.com/2012/05/excel-imprimer-les-commentaires.html

Sinon petite astuce:

Clic droit sur le commentaire, Format de commentaire et mettre la police en blanc
0
cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
21 nov. 2015 à 17:59
cliquez sur le logo en haut à gauche, Options Excel, Option avancées
et voir si cela est comme ça:


0
CarineVL Messages postés 122 Date d'inscription samedi 7 novembre 2015 Statut Membre Dernière intervention 3 septembre 2023
22 nov. 2015 à 09:52
Bonjour,
J'ai bien coché maintanant "indicateur seul et commentaires au survol"
Merci ...
J'avais déjà trouvé une solution pour ne pas imprimer les commentaires avec le code suivant:
' ne pas imprimer les commentaires
ActiveSheet.PageSetup.PrintComments = xlPrintNoComments

Cordialement,
CVL
0
cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
21 nov. 2015 à 13:36
Bonjour,

Comme cela:

Private Sub CommandButton1_Click()
 Application.DisplayCommentIndicator = xlCommentIndicatorOnly 'masquer
End Sub

Private Sub CommandButton2_Click()
 Application.DisplayCommentIndicator = xlCommentAndIndicator 'afficher
End Sub

Private Sub CommandButton3_Click()
 Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
End Sub

-1
CarineVL Messages postés 122 Date d'inscription samedi 7 novembre 2015 Statut Membre Dernière intervention 3 septembre 2023
21 nov. 2015 à 17:20
Bonjour, les commentaires s'impriment toujours.
Pourtant dans mise en page, feuille :: "aucun" est bien sélectionné !.
Après la macro, quand j'y retourne , il indique à Commentaires: "A la fin de la feuille"
J'ai inséré le code à plusieurs endroits mais rien n'y fait ...

Voici le code en dessous ...

Merci de me conseiller ...

Cordialement
CVL
:
Sub imprimer_env_DetailMargesok()
' imprimer_enveloppe_détail avec marges gauches et droites à 0
' mise à 0 des marges et commentaires aucun

' Mettre les marges à 0 dans la nouvelle feuille créée
Application.PrintCommunication = False
Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$A$3:$G$116"
Application.PrintCommunication = False
Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = "0" 'Application.InchesToPoints(0)
.RightMargin = "0" 'Application.InchesToPoints(0)
.TopMargin = "35" 'Application.InchesToPoints(0.748031496062992)
.BottomMargin = "35" 'Application.InchesToPoints(0.748031496062992)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = True
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""

End With
Application.PrintCommunication = True
Application.DisplayCommentIndicator = xlNoIndicator 'masquer indicateur

'Impression de la sélection

Range("A189:G254").Select
Application.CutCopyMode = False
ActiveSheet.PageSetup.PrintArea = "$A$189:$G$254"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
IgnorePrintAreas:=False
Range("A3:G116").Select
Range("H1").Activate
ActiveSheet.PageSetup.PrintArea = "$A$3:$G$116"
ActiveWorkbook.Save
Range("H1").Select
Application.PrintCommunication = False
MsgBox "Le document à coller sur l'enveloppe s'imprime avec les marges à zéro."
End Sub
0