Sub
autofiltering2()
Dim
col
As
String
, cfind
As
Range
Dim
Wertbereich
As
Range
col =
"Type"
With
Worksheets(
"Ergebnis"
)
With
.Range(
"A1"
, .Cells(1, .Columns.Count).
End
(xlToLeft))
Set
cfind = .Rows(1).Find(what:=
"Haarfarbe"
, LookIn:=xlValues, lookat:=xlWhole)
If
Not
cfind
Is
Nothing
Then
Werte = .Range(cfind.Offset(1), Cells(Rows.Count, cfind.Column).
End
(xlUp))
Werte = Application.Transpose(Werte)
Do
a = Application.Match(
"Rot"
, Werte, 0)
If
Not
IsError(a)
Then
Werte(a) =
""
Loop
Until
IsError(a)
.AutoFilter Field:=cfind.Column, Criteria1:=Werte, Operator:=xlFilterValues
End
If
End
With
Stop
.AutoFilterMode =
False
End
With
End
Sub