Private Sub CommandButton1_Click() Dim Rep%
Dim nbrCopie As Integer
Application.ScreenUpdating = False
'Sheets("Feuil1").Unprotect Password:="1012" 'ote la protection de la feuille
With ActiveSheet
With .PageSetup
.PrintTitleRows = "$2:$20" ' Lignes titre
.PrintArea = " B3:J57" ' Zone d'impression (à régler)
End With
Dim Flag As Boolean, I As Integer
For I = 34 To 21 Step -1
If Range("C" & I) = "" Then
Rows(I).Hidden = True
Else
Range("C" & I & ":I" & I).Interior.ColorIndex = IIf(Flag, 15, 19)
Flag = Not Flag
End If
Next I
.PrintPreview 'Aperçu avant impression
For I = 34 To 21 Step -1
Rows(I).Hidden = False
Range("C" & I & ":I" & I).Interior.ColorIndex = IIf(Flag, 15, 19)
Flag = Not Flag
Next I
' nbrCopie = InputBox("Combien de copie voulez-vous faire ?", Title:="Copies")
' If nbrCopie = 0 Then
' Exit Sub
' Else
' ActiveWindow.SelectedSheets.PrintOut Copies:=nbrCopie, Collate:=True
' End If
End With
On Error Resume Next
'ActiveSheet.ShowAllData
Application.Goto Range("A1"), Scroll:=True
' Sheets("Feuil1").Protect Password:="1012" 'remet la protection de la feuille
Application.ScreenUpdating = True
End Sub