Sub Report11()
Dim x As Byte
Application.ScreenUpdating = False
With Sheets("Ligne")
Tablo1 = .Range("B6:B9") ' Copie des valeurs de base
Derlig1 = .Range("A65000").End(xlUp).Row
If Derlig1 < 19 Then Exit Sub
NbLignes = Derlig1 - 18
' Nombre de lignes de la commande N° 1
' Mise en tableau des valeurs de la commande N° 1
ReDim Tablo2(1 To NbLignes, 1 To 7)
For i = 1 To UBound(Tablo2, 1)
[COLOR="Blue"]x = 1[/COLOR]
For j = 1 To UBound(Tablo2, 2)
If j [COLOR="Blue"]< 5[/COLOR] Then ' Valeurs de base de la commande N° 1
Tablo2(i, j) = Tablo1([COLOR="Blue"]x[/COLOR], 1)
Else ' Valeur des rouleaux
Tablo2(i, j) = .Cells(i + [COLOR="Blue"]18[/COLOR], j - 4)
End If
[COLOR="Blue"]x = x + 1[/COLOR]
Next j
Next i
End With
'Report de la commande N° 1
With Sheets("sauvegarde")
.EnableSelection = xlNoRestrictions
Derlig2 = .Range("A65000").End(xlUp).Row + 1
Range(.Cells(Derlig2, 1), .Cells(Derlig2 + NbLignes - 1, 7)) = Tablo2
.EnableSelection = xlNoSelection
End With
' Effacement de la commande N°1
With Sheets("Ligne")
.Range("B6:B9,D18").ClearContents
.Range("A19:C" & Derlig1).ClearContents
End With
End Sub