'****************************************
'IMPRIMER 3 PAGES DEPUIS LA PAGE ACCUEIL
'MERCI A Rag02700 POUR LE CODAGE INITIAL
'****************************************
Sub ButtonPrintStats()
Dim bStatP As Boolean, bStatM As Boolean, bStatG As Boolean
'**********
'LES LIGNES A MASQUER SONT ICI
Sheets("Stats population").Range("12:13").EntireRow.Hidden = True
'***********'
If Sheets("Stats population").Visible = True Then bStatP = True Else Sheets("Stats population").Visible = True
If Sheets("Stats métiers").Visible = True Then bStatM = True Else Sheets("Stats métiers").Visible = True
If Sheets("Stats générales").Visible = True Then bStatG = True Else Sheets("Stats générales").Visible = True
'Feuil2.Copy '???
'With Sheets("Stats population") 'Paramètres pour l'impression. Doit revenir à l'état d'origine après l'impression
        '.[12:13].EntireRow.Hidden = True 'Masque des lignes
        '.[9:10].EntireRow.Interior.ColorIndex = xlNone 'Intérieur incolore des lignes
        '.[D15:E15,G15:H15].Interior.Color = [A1].Interior.Color 'Colore la plage en blanc selon la cellule [A1] non masquée
        '.[D15:E15,G15:H15].Font.ColorIndex = 1 'Données renseignées - Colore le texte en noir (1 = noir)
        '.[D15:E15,G15:H15].Borders.LineStyle = xlNone 'Bordures de cellules incolores
With Sheets("Stats population").PageSetup
            .Zoom = False
            .PrintArea = "C4:M26" 'Zone d'impression
            .LeftMargin = Application.InchesToPoints(0.5) 'Marge gauche
            .RightMargin = Application.InchesToPoints(0.8)  'Marge droite
            .TopMargin = Application.InchesToPoints(0.8) 'Marge haut de page ou top
            .BottomMargin = Application.InchesToPoints(0.8) 'Marge bas de page si nécessaire
            .FitToPagesWide = 1 'Définit le nombre de pages à l’échelle
            .FitToPagesTall = 1 'Définit le nombre de pages en hauteur
            .Orientation = xlLandscape 'Portrait = xlPortrait ou Paysage = xlLandscape
            Application.Goto Sheets("Stats population").Range("A1") 'Remonte en haut de la page
            Application.Goto Sheets("Stats population").Range("F6") 'Se position dans la cellule
        'End With
End With
With Sheets("Stats métiers").PageSetup
            .Zoom = False
            .PrintArea = "D5:N27" 'Zone d'impression
            .LeftMargin = Application.InchesToPoints(0.8) 'Marge gauche
            .RightMargin = Application.InchesToPoints(0.1)  'Marge droite
            .TopMargin = Application.InchesToPoints(0.8) 'Marge haut de page ou top
            .BottomMargin = Application.InchesToPoints(0.8) 'Marge bas de page si nécessaire
            .FitToPagesWide = 1 'Définit le nombre de pages à l’échelle
            .FitToPagesTall = 1 'Définit le nombre de pages en hauteur
            .Orientation = xlLandscape 'Portrait = xlPortrait ou Paysage = xlLandscape
End With
With Sheets("Stats générales").PageSetup
            .Zoom = False
            .PrintArea = "E6:O28" 'Zone d'impression
            .LeftMargin = Application.InchesToPoints(0.8) 'Marge gauche
            .RightMargin = Application.InchesToPoints(0.1)  'Marge droite
            .TopMargin = Application.InchesToPoints(0.8) 'Marge haut de page ou top
            .BottomMargin = Application.InchesToPoints(0.8) 'Marge bas de page si nécessaire
            .FitToPagesWide = 1 'Définit le nombre de pages à l’échelle
            .FitToPagesTall = 1 'Définit le nombre de pages en hauteur
            .Orientation = xlLandscape 'Portrait = xlPortrait ou Paysage = xlLandscape
End With
Sheets(Array("Stats population", "Stats métiers", "Stats générales")).PrintPreview 'Prévisualiser
'**********
'LES LIGNES A DEMASQUER SONT ICI
Sheets("Stats population").Range("12:13").EntireRow.Hidden = False
'**********
Sheets("Stats métiers").Visible = bStatM
Sheets("Stats générales").Visible = bStatG
Sheets("Accueil").Select
End Sub