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 42 43
| Sub Macro1()
Dim cel As Range
Dim plage As Range
Dim plage1 As Range
With Sheets("Sheet1")
Set plage = .Range("A2:A197")
Set plage1 = .Range("C2:C197")
For Each cel In plage
If cel.Offset(0,6).value < 500 Then
if cel.Offset(0,7).Value=1 and cel.Offset(0,8).Value=1
then cel.Offset(0,9).Value=1.68
End If
if cel.Offset(0,7).Value=1 and cel.Offset(0,8).Value=0
then cel.Offset(0,9).Value=1.68
End If
if cel.Offset(0,7).Value=2 and cel.Offset(0,8).Value=0
then cel.Offset(0,9).Value=1.67
End If
if cel.Offset(0,7).Value=2 and cel.Offset(0,8).Value=1
then cel.Offset(0,9).Value=2
End If
End If
If cel.Offset(0,6).value < 1000 and cel.Offset(0,6).value > 500
if cel.Offset(0,7).Value=1 and cel.Offset(0,8).Value=1
then cel.Offset(0,9).Value=1.5
End If
if cel.Offset(0,7).Value=1 and cel.Offset(0,8).Value=0
then cel.Offset(0,9).Value=1.6
End If
if cel.Offset(0,7).Value=2 and cel.Offset(0,8).Value=0
then cel.Offset(0,9).Value=1.67
End If
if cel.Offset(0,7).Value=2 and cel.Offset(0,8).Value=1
then cel.Offset(0,9).Value=2.2
End If
End If
Application.Goto Reference:="Macro1"
End Sub |
Partager