Re: InputBox Filter
14.12.2002 17:06:59
Dietmar E
So Ich habe mir jetzt selbst was gebastelt.
Ist recht lang geworden.
Einziger Fehler ist noch Operator:= undoder, _
Das klappt noch nicht.
Wie krieg ich das noch hin ?
Bitte um eure Hilfe!Sub Spezialfilter()
If Sheets("Verzeichnis").AutoFilterMode = True Then
Sheets("Verzeichnis").Range("A1").AutoFilter
End If
Dim rng As Range
Dim sBegriff As String, sAddress As String, sReihe As String, sSpalte As String, sGk1 As String, sKg1 As String, undoder As String
sBegriff = InputBox( _
prompt:="Bitte unteres Abmass eingeben:", _
Default:="0")
If sBegriff = "" Then Exit Sub
sAddress = InputBox( _
prompt:="Bitte oberes Abmass eingeben:", _
Default:="0")
If sAddress = "" Then Exit Sub
sReihe = InputBox( _
prompt:="Bitte Reihe eingeben:", _
Default:="0")
If sReihe = "" Then Exit Sub
sSpalte = InputBox( _
prompt:="Bitte zu filternte Spalte eingeben:", _
Default:="0")
If sSpalte = "" Then Exit Sub
sKg1 = InputBox( _
prompt:="Bitte Bedingung1 >< eingeben:", _
Default:="0")
If sKg1 = "" Then Exit Sub
sGk1 = InputBox( _
prompt:="Bitte Bedingung2 >< eingeben:", _
Default:="0")
If sGk1 = "" Then Exit Sub
undoder = InputBox( _
prompt:="Bitte Bedingung3 xlOr-xlAnd eingeben:", _
Default:="0")
If undoder = "" Then Exit Sub
Rows(sReihe).Select
Selection.AutoFilter
Selection.AutoFilter Field:=sSpalte, Criteria1:=sKg1 & sBegriff, Operator:= undoder, _
Criteria2:=sGk1 & sAddress
Cells(ActiveCell.Row, 1).Select
End Sub