Macro "signature"

Rick@

XLDnaute Occasionnel
Bonjour,

Je me suis fais une macro pour signer mes documents. J'ai utilisé l'enregistreur de macro mais voilà, c'est vraiment long. Je ne suis pas expert en VBA mais il y a sûrement moyen de simplifier la formule...

Merci pour votre expertise!

Sub Signature()
'
' Signature Macro
' Macro enregistrée le 2012-03-13 par bh7997
'

'
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
ActiveSheet.PageSetup.PrintArea = "$B$1:$V$36"
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = _
"&""Arial,Gras italique""&5Rick@&""Arial,Italique""" & Chr(10) & "Équipe support opérationnel DCRC"
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
.PaperSize = xlPaperLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
End Sub
 

JCGL

XLDnaute Barbatruc
Re : Macro "signature"

Bonjour à tous,

Peux-tu essayer :

VB:
With ActiveSheet.PageSetup
.RightFooter = "&""Arial,Gras italique""&5Rick@&""Arial,Italique""" & Chr(10) & "Équipe support opérationnel DCRC"
.LeftMargin = Application.InchesToPoints(0)
.RightMargin = Application.InchesToPoints(0)
.TopMargin = Application.InchesToPoints(0)
.BottomMargin = Application.InchesToPoints(0)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.FirstPageNumber = xlAutomatic
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

A + à tous
 

JCGL

XLDnaute Barbatruc
Re : Macro "signature"

Bonjour à tous,

J'ai oublié une précision qui a son importance...

Soit tu mets ce code dans un module standard et tu mets en première ligne

VB:
Sub Signature()
... le code ...
End Sub

ou dans le module ThisWorkBook

VB:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
... le code ...
End Sub

A chaque impression la signature sera apposée automatiquement

A + à tous

Edition : Lance un Aperçu avant Impression...
 

Pièces jointes

  • JC Signature Pied de Page.xls
    30 KB · Affichages: 46
Dernière édition:

Discussions similaires

Statistiques des forums

Discussions
312 548
Messages
2 089 495
Membres
104 186
dernier inscrit
SEven22