XL 2016 impression par semaine

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

lamho27

XLDnaute Occasionnel
Bonjour le forum
j'ai un calendrier avec 6 semaine ; je voudrais impression soit semaine par semaine soit page entier
merci d'avance
j'ai un macro pour impression par semaine ; c'est bon pour 1er semaine, mais 2eme semaine il imprime semaines 1et 2
code
Sub Impression()
'
Dim Sem, i As Integer
'
Sem = InputBox("Numéro semaine?")


If Sem = 1 Then
i = 0

Else
i = (Sem - 1) * 7

End If

Range("A" & (6 + i) & ":" & "Z" & (12 + i)).Select
Selection.PrintOut Copies:=1, Collate:=True


End Sub
 

Pièces jointes

Dernière édition:
Bonjour le forum

Une macro testée avec Excel 2010.
VB:
Sub Impression()
Dim Sem, Cell_SEM As Range
Sem = InputBox("Numéro semaine?")
Set Cell_SEM = Columns(5).Find(What:=Sem, After:=Cells(4, 5), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByRows)
ActiveSheet.PageSetup.PrintArea = Cells(Cell_SEM.Row, 1).Resize(10, 27).Address
Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .LeftMargin = Application.InchesToPoints(0)
        .RightMargin = Application.InchesToPoints(0)
        .TopMargin = Application.InchesToPoints(0)
        .BottomMargin = Application.InchesToPoints(0)
        .HeaderMargin = Application.InchesToPoints(0)
        .FooterMargin = Application.InchesToPoints(0)
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlLandscape
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
    Application.PrintCommunication = True
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub
 
Bonjour le forum

Une page contenant tout le calendrier, c'est ça?
La macro a été enregistrée avec l'enregistreur
VB:
Sub Macro1()
Application.PrintCommunication = True
ActiveSheet.PageSetup.PrintArea = "$A$1:$Z$65"
Application.PrintCommunication = False
    With ActiveSheet.PageSetup
        .LeftMargin = Application.InchesToPoints(0)
        .RightMargin = Application.InchesToPoints(0)
        .TopMargin = Application.InchesToPoints(0)
        .BottomMargin = Application.InchesToPoints(0)
        .HeaderMargin = Application.InchesToPoints(0)
        .FooterMargin = Application.InchesToPoints(0)
        .PrintQuality = 600
        .CenterHorizontally = True
        .CenterVertically = True
        .Orientation = xlPortrait
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = 1
    End With
Application.PrintCommunication = True
ActiveSheet.PrintOut Copies:=1, Collate:=True
End Sub
 
Dernière édition:
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
7
Affichages
163
Réponses
10
Affichages
281
Réponses
5
Affichages
236
Réponses
5
Affichages
232
  • Question Question
Microsoft 365 worksheet_change
Réponses
29
Affichages
479
Réponses
4
Affichages
177
Retour