1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub toto()
Dim Tabl(), i As Long, j As Long
Const CIBLE As String = "Sorties"
Const MAFEUILLE As String = "NomDeMaFeuille"
With ThisWorkbook.Worksheets(MAFEUILLE).Cells(7, 1).CurrentRegion
Tabl = .Offset(6, 0).Resize(.Rows.Count - 6, .Columns.Count).Value
End With
For i = LBound(Tabl, 1) To UBound(Tabl, 1)
If Tabl(i, 3) = CIBLE Then
For j = LBound(Tabl, 2) To UBound(Tabl, 2)
If IsNumeric(Tabl(i, j)) And Tabl(i, j) > 0 And Not Tabl(i, j) = "" Then Tabl(i, j) = Tabl(i, j) * -1
Next j
End If
Next i
With ThisWorkbook.Worksheets(MAFEUILLE).Cells(7, 1).CurrentRegion
.Offset(6, 0).Resize(.Rows.Count - 6, .Columns.Count).Value = Tabl
End With
End Sub |
Partager