Sub
Sort3()
Dim
Zeile
As
Integer
, a
As
Integer
Dim
x
As
Range, y
As
Range
For
a = 1
To
15
Step
1
Zeile = 2
For
Each
cell
In
Sheets(
"Ursprung"
).Range(
"S2:S1002"
)
If
(Sheets(
"Ursprung"
).Cells(Zeile, 3) =
"Demand"
Or
Sheets(
"Ursprung"
).Cells(Zeile, 3) =
"Hotfix"
)
And
(Sheets(
"Ursprung"
).Cells(Zeile + 1, 3) =
"Demand"
Or
Sheets(
"Ursprung"
).Cells(Zeile + 1, 3) =
"Hotfix"
)
Then
If
Sheets(
"Ursprung"
).Cells(Zeile, 19).Value > Sheets(
"Ursprung"
).Cells(Zeile + 1, 19).Value
Then
x = Sheets(
"Ursprung"
).Range(.Cells(Zeile, 1), .Cells(Zeile, 14))
y = Sheets(
"Ursprung"
).Range(.Cells(Zeile + 1, 1), .Cells(Zeile + 1, 14))
Sheets(
"Ursprung"
).Range(.Cells(Zeile, 1), .Cells(Zeile, 14)) = y
Sheets(
"Ursprung"
).Range(.Cells(Zeile + 1, 1), .Cells(Zeile + 1, 14)) = x
End
If
End
If
Zeile = Zeile + 1
Next
Next
End
Sub