Sub
MakroDeutsch()
Dim
ws
As
Worksheet
Dim
lastRow
As
Long
Dim
i
As
Long
Set
ws = ThisWorkbook.Sheets(
"Working Sheet"
)
lastRow = ws.Cells(ws.Rows.Count,
"AX"
).
End
(xlUp).Row
ws.Range(
"AX1"
).Value =
"neuer Wert"
For
i = 2
To
lastRow
If
ws.Cells(i,
"AW"
).Value = 3
Then
If
ws.Cells(i,
"AK"
).Value > 30
And
ws.Cells(i,
"AN"
).Value = 0
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.9
ElseIf
ws.Cells(i,
"AK"
).Value > 18
And
ws.Cells(i,
"AK"
).Value <= 30
And
ws.Cells(i,
"AN"
).Value = 0
And
ws.Cells(i,
"AM"
).Value > 30
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.75
ElseIf
ws.Cells(i,
"AK"
).Value <= 18
And
ws.Cells(i,
"AK"
).Value > 10
And
ws.Cells(i,
"AN"
).Value = 0
And
ws.Cells(i,
"AM"
).Value > 30
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.82
ElseIf
ws.Cells(i,
"AK"
).Value <= 10
And
ws.Cells(i,
"AK"
).Value > 5
And
ws.Cells(i,
"AN"
).Value = 0
And
ws.Cells(i,
"AM"
).Value > 30
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.89
ElseIf
ws.Cells(i,
"AK"
).Value >= 1
And
ws.Cells(i,
"AK"
).Value <= 5
And
ws.Cells(i,
"AN"
).Value = 0
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value
ElseIf
ws.Cells(i,
"AT"
).Value <= 1
And
ws.Cells(i,
"AK"
).Value > 15
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.65
ElseIf
ws.Cells(i,
"AT"
).Value <= 1
And
ws.Cells(i,
"AK"
).Value > 5
And
ws.Cells(i,
"AK"
).Value <= 15
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.75
ElseIf
ws.Cells(i,
"AT"
).Value <= 1
And
ws.Cells(i,
"AK"
).Value <= 5
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value
ElseIf
ws.Cells(i,
"AT"
).Value > 1
And
ws.Cells(i,
"AT"
).Value <= 2
And
ws.Cells(i,
"AK"
).Value > 20
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.8
ElseIf
ws.Cells(i,
"AT"
).Value > 1
And
ws.Cells(i,
"AT"
).Value <= 2
And
ws.Cells(i,
"AK"
).Value <= 19
And
ws.Cells(i,
"AK"
).Value > 10
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.87
ElseIf
ws.Cells(i,
"AT"
).Value > 1
And
ws.Cells(i,
"AT"
).Value <= 2
And
ws.Cells(i,
"AK"
).Value <= 10
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value
ElseIf
ws.Cells(i,
"AT"
).Value > 2
And
ws.Cells(i,
"AT"
).Value <= 3.2
And
ws.Cells(i,
"AK"
).Value > 20
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.88
ElseIf
ws.Cells(i,
"AT"
).Value > 2
And
ws.Cells(i,
"AT"
).Value <= 3.2
And
ws.Cells(i,
"AK"
).Value <= 19
And
ws.Cells(i,
"AK"
).Value > 10
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 0.9
ElseIf
ws.Cells(i,
"AT"
).Value > 2
And
ws.Cells(i,
"AT"
).Value <= 3.2
And
ws.Cells(i,
"AK"
).Value <= 10
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value
ElseIf
ws.Cells(i,
"AT"
).Value > 3.2
And
ws.Cells(i,
"AT"
).Value <= 5
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value
ElseIf
ws.Cells(i,
"AT"
).Value > 5
And
ws.Cells(i,
"AT"
).Value <= 6
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 1.05
ElseIf
ws.Cells(i,
"AT"
).Value > 6
And
ws.Cells(i,
"AT"
).Value <= 8
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 1.1
ElseIf
ws.Cells(i,
"AT"
).Value > 8
And
ws.Cells(i,
"AT"
).Value <= 20
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 1.2
ElseIf
ws.Cells(i,
"AT"
).Value > 20
Then
ws.Cells(i,
"AX"
).Value = ws.Cells(i,
"AB"
).Value * 1.3
End
If
End
If
Next
i
End
Sub