Option Explicit
Sub nettoie()
nettoyage
End Sub
Function nettoyage()
With Sheets("bulletins")
.Cells(1, "AJ").Resize(, .UsedRange.Columns.Count).EntireColumn.Delete Shift:=xlToLeft
Do While .UsedRange.Cells(1, .UsedRange.Cells.Count).Column = .Cells(1, "AI").Column: DoEvents: Loop
End With
nettoyage = True
End Function
Sub createBulletin()
Dim X As Boolean, NbCopY&, plage As Range, NbCol&, CoL1&, LargeurCol&, C&, NewPlage As Range
X = nettoyage
Application.ScreenUpdating = False
NbCopY = 20
Set plage = [Bulletins!L1:AI93]
NbCol = plage.Columns.Count
CoL1 = [AJ1].Column
LargeurCol = [Bulletins!L1].Width
DoEvents
For C = 1 To NbCopY
plage.Copy Destination:=Cells(1, CoL1)
ActiveWindow.SelectedSheets.VPageBreaks.Add Before:=Cells(1, CoL1)
CoL1 = CoL1 + NbCol
Set NewPlage = Sheets("Bulletins").Cells(1, CoL1).Resize(plage.Rows.Count, plage.Columns.Count)
With NewPlage
'on peut remplir le nouveau bulletin
'.cells(x,y)=bidule
'etc...
'...
End With
Next
ActiveSheet.UsedRange.ColumnWidth = [Bulletins!L:L].ColumnWidth
ActiveSheet.PageSetup.PrintArea = Sheets("bulletins").Range(Cells(1, "L"), Cells(93, plage.Columns.Count * NbCopY)).Resize(93).Address
End Sub