'============================================
Private Sub CommandButton2_Click() 'Imprimer Module
Dim Col%, Posit%, Posit2%
Dim Début&, Fin&, Plage$
Dim P1$, P2$, P3$, P4$, P5$, P6$
Application.ScreenUpdating = False
Sheets("Feuil1").Activate
'----- Mise en place du Titre du Module ------
Col = Cells(2, 3).Value
Cells(2, Col + 1).Value = TextBox5.Value
'----------- Plage ------------
Début = Label3.Caption
Fin = Label4.Caption
'------- Extrait 1° caractère de la plage -----
P1 = Columns(Col + 1).Address
P2 = Right(P1, Len(P1) - 1)
Posit = InStr(1, P2, ":")
P3 = Left(P2, Posit - 1)
'------- Extrait 2° caractère de la plage -----
P4 = Columns(Col + 1).Address
P5 = Right(P4, Len(P1) - 1)
Posit2 = InStr(1, P5, ":")
P6 = Left(P5, Posit2 - 1)
'-------------- Plage Imprimer ----------------
Plage = P3 & Début & ":" & P6 & Fin
'-------- Impression ----------
Sheets("Feuil1").Activate
With ActiveSheet.PageSetup
.PrintTitleRows = "$1:$3"
.Orientation = 1
.Zoom = 100
.PrintArea = Plage
End With
ActiveWindow.SelectedSheets.PrintOut copies:=1
'----- Restitution de l'intitulé ------
Cells(2, Col + 1).Value = "Macros VBA Excel"
Application.ScreenUpdating = True
Sheets("Feuil1").Select
Range("A1").Select
End Sub
'============================================