XL 2016 Macro imprimer que les cellules pleines

berru76

XLDnaute Occasionnel
Bonjour
j'ai 2 macros imprimer une liste inscription en A3 ou A4 faites avec développeur / enregistrer une macro selon nos imprimantes comment faire pour n' imprimer que les feuilles avec des cellules pleines (noms des participants )
Merci


Sub ImpinscA3()

'
Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="2021"
Range("B3:E60").Select
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.393700787401575)
.RightMargin = Application.InchesToPoints(0.393700787401575)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA3
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 69
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
ActiveSheet.Protect "2021", False
Application.ScreenUpdating = True
End Sub
----------------------------------------------------------------------------------------------------------------
Sub ImpinscA4()

'
Application.ScreenUpdating = False
ActiveSheet.Unprotect Password:="2021"
Range("B3:E99").Select
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End With
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = ""
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.393700787401575)
.RightMargin = Application.InchesToPoints(0.393700787401575)
.TopMargin = Application.InchesToPoints(0.393700787401575)
.BottomMargin = Application.InchesToPoints(0.393700787401575)
.HeaderMargin = Application.InchesToPoints(0.31496062992126)
.FooterMargin = Application.InchesToPoints(0.31496062992126)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.CenterHorizontally = True
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = 69
.PrintErrors = xlPrintErrorsDisplayed
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.ScaleWithDocHeaderFooter = True
.AlignMarginsHeaderFooter = False
.EvenPage.LeftHeader.Text = ""
.EvenPage.CenterHeader.Text = ""
.EvenPage.RightHeader.Text = ""
.EvenPage.LeftFooter.Text = ""
.EvenPage.CenterFooter.Text = ""
.EvenPage.RightFooter.Text = ""
.FirstPage.LeftHeader.Text = ""
.FirstPage.CenterHeader.Text = ""
.FirstPage.RightHeader.Text = ""
.FirstPage.LeftFooter.Text = ""
.FirstPage.CenterFooter.Text = ""
.FirstPage.RightFooter.Text = ""
End With
Application.PrintCommunication = True
Selection.PrintOut Copies:=1, Collate:=True
Range("A1").Select
ActiveSheet.Protect "2021, False
Application.ScreenUpdating = True
End Sub
 

Pièces jointes

  • A3.txt
    2.3 KB · Affichages: 1
  • A4.txt
    2.3 KB · Affichages: 1
  • Capture.PNG
    Capture.PNG
    29.3 KB · Affichages: 25
Dernière édition:

berru76

XLDnaute Occasionnel
Salut c'est pas bon j ai teste m' imprime les 3 feuilles quand même
Excuser moi je me suis mal expliquer Je voudrais n' imprimer que les feuilles avec des cellules pleines (noms des participants )
Merci a qui peut m'aider
 
Dernière édition:

berru76

XLDnaute Occasionnel
Salut
En mettant
Range("B3:E"&Cells(Rows.Count, 3).End(xlUp).Row).Select
les 3 feuilles sont imprimées
En mettant
Range("C3:E"&Cells(Rows.Count, 3).End(xlUp).Row).Select
cela fonctionne mais je n'ai plus le numéros des équipes de la colonne B
avez vous une idée pour imprimer colonne B jusqu' au nombre de participants
ci joint un exemple du fichier
 

Pièces jointes

  • G G .xlsm
    129.9 KB · Affichages: 3

Statistiques des forums

Discussions
315 093
Messages
2 116 126
Membres
112 666
dernier inscrit
Coco0505