Salut niki42
je n'ai pas d'imprimante connectée a mon portable mais j'ai fais une recherche sur le net et je suis tombé sur des macro qui concerne l'impression
j'ai donc modifié ta macro mais sans plus je te mets le code
Sub MaMacro2()
'
Dim info As String
info = ActiveSheet.Name & Chr(32) & Format(Date, 'yyyy')
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.PrintTitleRows = ''
.PrintTitleColumns = ''
End With
With ActiveSheet.PageSetup
.CenterHeader = '&''Comic Sans MS,Gras''&16' & info
.CenterFooter = 'Imprimé le &D à &T'
.LeftMargin = Application.InchesToPoints(0.196850393700787)
.RightMargin = Application.InchesToPoints(0.196850393700787)
.TopMargin = Application.InchesToPoints(0.590551181102362)
.BottomMargin = Application.InchesToPoints(0.590551181102362)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
ActiveSheet.PageSetup.PrintArea = '$A$1:$AG$50'
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Application.ScreenUpdating = True
End Sub
New Edition
voilà je pense que cela fonctionne car en ajoutant un Preview cela montre le résultat
ActiveSheet.PageSetup.PrintArea = '$A$1:$G$26'
ActiveWindow.SelectedSheets.PrintPreview
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
bonne soirée
voir le Lien:
ICI
Message édité par: Chti160, à: 28/12/2005 21:58