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
| Sub Erreur_sage_4()
Dim i&, J&, K&
Dim Var As Variant, T As Variant
Dim Rng As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With ThisWorkbook.Sheets("Erreurs Sage")
.Range("A2:I100").ClearContents
.Range("A2:I202").Value = Sheets("Livret").Range("A1:I201").Value
.Range("A203:I283").Value = Sheets("Poste 9 regard+couv").Range("A1:I81").Value
.Range("A284:I334").Value = Sheets("Poste 9 aspi").Range("A1:I51").Value
.Range("A335:I405").Value = Sheets("Appuis").Range("A1:I71").Value
.Range("A406:I446").Value = Sheets("Prélinteaux").Range("A1:I41").Value
.Range("A447:I497").Value = Sheets("Poste 10 regards").Range("A1:I51").Value
.Range("A498:I538").Value = Sheets("Poste 10 aspi").Range("A1:I41").Value
.Range("A539:I589").Value = Sheets("Poste 11 regards").Range("A1:I51").Value
.Range("A590:I630").Value = Sheets("Poste 11 aspi").Range("A1:I41").Value
Set Rng = .Range(.Cells(2, 1), .Cells(.Rows.Count, 1).End(3)(1, 9))
T = Rng
For i = LBound(T, 1) To UBound(T, 1)
Var = T(i, 9)
If Var <> "0" And Var <> "" And T(i, 1) <> "Code" Then
J = J + 1
For K = LBound(T, 2) To UBound(T, 2)
T(J, K) = T(i, K)
Next K
End If
Next i
Rng.ClearContents
If J > 0 Then Rng.Resize(J, UBound(T, 2)) = T
.Columns("D:I").Delete Shift:=xlToLeft
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub |
Partager