Sub
Cluster1()
Dim
Block
As
Variant
Dim
Zeile(1
To
7)
As
Long
Dim
stp(1
To
7)
As
Integer
Block =
"Cluster 1"
Z = Worksheets(Block).Cells(1, 4).Interior.Color
For
J = 1
To
5
If
Worksheets(Block).Cells(J, 2) <> 0
Then
stp(J) = Worksheets(Block).Cells(J, 2).Value
Zeile(J) = Columns(
"A:A"
).Find(What:=stp(J), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
).Row
End
If
Next
For
i = 2
To
10
If
Cells(Zeile(3), i).Value =
"x"
And
Cells(Zeile(4), i).Value =
"x"
And
Cells(Zeile(5), i).Value =
"x"
Then
Range(Cells(Zeile(1), i), Cells(Zeile(2) - 1, i)).
Select
Cells(Zeile(2) - 1, i).Activate
With
Selection.Interior
.Color = Z
End
With
End
If
Next
i
End
Sub
Sub
Cluster2()
Dim
Block
As
Variant
Dim
Zeile(1
To
7)
As
Long
Dim
stp(1
To
7)
As
Integer
Block =
"Cluster 2"
Z = Worksheets(Block).Cells(1, 4).Interior.Color
For
J = 1
To
4
If
Worksheets(Block).Cells(J, 2) <> 0
Then
stp(J) = Worksheets(Block).Cells(J, 2).Value
Zeile(J) = Columns(
"A:A"
).Find(What:=stp(J), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=
False
, SearchFormat:=
False
).Row
End
If
Next
For
i = 2
To
10
If
Cells(Zeile(3), i).Value =
"x"
And
Cells(Zeile(4), i).Value =
"x"
Then
Range(Cells(Zeile(1), i), Cells(Zeile(2) - 1, i)).
Select
Cells(Zeile(2) - 1, i).Activate
With
Selection.Interior
.Color = Z
End
With
End
If
Next
i
End
Sub