Private Sub CommandButton2_imprimer_Click()
Dim Ws As Worksheet
'pplication.ScreenUpdating = False
'Copie d'écran de la forme active
keybd_event vbKeySnapshot, 1, 0&, 0&
DoEvents
'Ajoute une feuille pour coller l'image de la forme
Set Ws = Sheets.Add
Ws.PageSetup.Orientation = xlLandscape
Ws.Paste
Unload Me
'Impression centrée dans la page
With Ws
.PageSetup.CenterHorizontally = True
.PageSetup.CenterVertically = True
.PageSetup.LeftMargin = 0
.PrintOut
End With
Application.DisplayAlerts = False
ActiveSheet.Delete
Application.DisplayAlerts = True
Application.ScreenUpdating = True
UserForm8_rechercher.PrintForm
End Sub