1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Sub controle()
Dim colE As Range, cel As Range
Set colE = ActiveSheet.Range("E1:E3") 'définir la zone
For Each cel In colE 'parcours des cellules
If Left(cel.Text, 2) = "AV" Then
If Cells(cel.Row, 6) <> 0 Or Cells(cel.Row, 7) <> 0 Then
If Cells(cel.Row, 6) <> 0 Then ' -Si la colonne F n'est pas égal à 0
Cells(cel.Row, 7) = Abs(Cells(cel.Row, 6))
Cells(cel.Row, 6) = 0
Else
Cells(cel.Row, 6) = Abs(Cells(cel.Row, 7)) ' -Si la colonne G n'est pas égal à 0
Cells(cel.Row, 7) = 0
End If
End If
Next cel
End Sub |
Partager