Sub
gütligkeit()
Dim
gültigliste
As
String
Dim
i
As
Long
Dim
letzte
As
Long
With
Sheets(
"Analysedaten"
)
gültigliste =
","
If
Sheets(
"Steuerungstabelle"
).Range(
"G3"
) =
"A"
Then
letzte = .Cells(Rows.Count, 1).
End
(xlUp).Row
For
i = 2
To
letzte
If
.Cells(i, 1) <>
""
And
IsNumeric(.Cells(i, 1))
Then
If
InStr(1, gültigliste,
","
& .Cells(i, 1) &
","
, vbTextCompare) = 0
Then
gültigliste = gültigliste &
CLng
(.Cells(i, 1)) &
","
End
If
Next
i
ElseIf
Sheets(
"Steuerungstabelle"
).Range(
"G3"
) =
"B"
Then
letzte = .Cells(Rows.Count, 5).
End
(xlUp).Row
For
i = 2
To
letzte
If
.Cells(i, 1) <>
""
And
IsNumeric(.Cells(i, 5))
Then
If
InStr(1, gültigliste,
","
& .Cells(i, 5) &
","
, vbTextCompare) = 0
Then
gültigliste = gültigliste &
CLng
(.Cells(i, 5)) &
","
End
If
Next
i
End
If
End
With