Pb sur Userform

Michel0

XLDnaute Nouveau
Bonsoir a tous,

J'ai crée un userform que je désire imprimer en l'état.

En cherchant sur tous les forums, j'ai réussi a trouver une routine me permettant de l'imprimer en paysage mais il me l'imprime sur 4 feuilles alors que je le veux sur une page uniquement.

Ci dessous vous trouverez la routine que j'ai "pompée".

merci d'avance pour votre aide !

With ActiveSheet
.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False
.Range("A1").Activate
.PageSetup.Orientation = xlLandscape
.PageSetup.LeftMargin = Application.InchesToPoints(0)
.PageSetup.RightMargin = Application.InchesToPoints(0)
.PageSetup.TopMargin = Application.InchesToPoints(0.3)
.PageSetup.BottomMargin = Application.InchesToPoints(0)
.PageSetup.HeaderMargin = Application.InchesToPoints(0)
.PageSetup.FooterMargin = Application.InchesToPoints(0)
.PageSetup.PrintHeadings = False
.PageSetup.PrintGridlines = False
.PageSetup.PrintComments = xlPrintNoComments
.PageSetup.CenterHorizontally = True
.PageSetup.CenterVertically = True
.PageSetup.Draft = False
.PageSetup.PaperSize = xlPaperA3
.PageSetup.Order = xlDownThenOver
.PageSetup.BlackAndWhite = False
.PageSetup.Zoom = 100


End With
ActiveWindow.SelectedSheets.PrintOut Copies:=1
ActiveWorkbook.Close False
Saisie_newFi.CommandButton2.SetFocus
Application.ScreenUpdating = True
 

Papou-net

XLDnaute Barbatruc
Re : Pb sur Userform

Bonsoir Michel0,

Essaie avec ce code modifié :

Code:
With ActiveSheet
.PasteSpecial Format:="Bitmap", Link:=False, DisplayAsIcon:=False
.Range("A1").Activate
With .PageSetup
  .Orientation = xlLandscape
  .LeftMargin = Application.InchesToPoints(0)
  .RightMargin = Application.InchesToPoints(0)
  .TopMargin = Application.InchesToPoints(0.3)
  .BottomMargin = Application.InchesToPoints(0)
  .HeaderMargin = Application.InchesToPoints(0)
  .FooterMargin = Application.InchesToPoints(0)
  .PrintHeadings = False
  .PrintGridlines = False
  .PrintComments = xlPrintNoComments
  .CenterHorizontally = True
  .CenterVertically = True
  .Draft = False
  .PaperSize = xlPaperA3
  .Order = xlDownThenOver
  .BlackAndWhite = False
  .Zoom = False
  .FitToPagesTall = 1
  .FitToPagesWide = 1
End With
End With
Cordialement.
 

Papou-net

XLDnaute Barbatruc
Re : Pb sur Userform

Bonjour Michel0, Pierrot,

Je m'etais pose la question de savoir s'il fallait imprimer la feuille ou l'UserForm, et je me suis fie a l'extrait de code depose.

Attendons de voir la reponse de Michel.

Cordialement..
 

Statistiques des forums

Discussions
312 493
Messages
2 088 956
Membres
103 990
dernier inscrit
lamiadebz