1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| Option Explicit
Dim N As Long, P, Ferme As Boolean
Private Sub CloseButton_Click()
SelectProcessRG.Hide
End Sub
Private Sub UserForm_Initialize()
ListBox1.RowSource = Range("BaseRG!F1:F27").Address
P = Array("5:7", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20:21" _
, "25", "26", "28:30", "31", "32", "33", "34:35", "39", "40", "41", "42:43", _
, "44", "45", "48", "49")
End Sub
Private Sub SelectAll_Click()
Ferme = True
Application.ScreenUpdating = False
Rows("5:49").EntireRow.Hidden = False
For N = 0 To ListBox1.ListCount - 1
ListBox1.Selected(N) = True
Next
Ferme = False
End Sub
Private Sub DeselectAll_Click()
Application.ScreenUpdating = False
Rows("5:49").EntireRow.Hidden = True
For N = 0 To ListBox1.ListCount - 1
ListBox1.Selected(N) = False
Next
End Sub
Private Sub ListBox1_Change()
If Ferme = True Then Exit Sub
Application.ScreenUpdating = False
For N = 0 To ListBox1.ListCount - 1
Rows(P(N)).EntireRow.Hidden = Not ListBox1.Selected(N)
Next
End Sub
Private Sub ShowButton_Click()
Dim derlig As Long, DerCol As Byte, Plage
derlig = Range("A65536").End(xlUp).Row
DerCol = Range("a1").End(xlToLeft).Column
Set Plage = Range(Cells(1, 1), Cells(derlig, DerCol))
SelectProcessRG.Hide
With Sheets("BaseRG")
With .PageSetup
.PrintArea = Plage
.Orientation = xlPortrait
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
.PrintPreview
End With
SelectProcessRG.Show 0
End Sub |
Partager