Option
Explicit
Sub
MeinAutoFilter()
Dim
laengeEingabe
As
Double
Dim
breiteEingabe
As
Double
Dim
hoeheEingabe
As
Double
Dim
c
As
Range, specc
As
Range
Dim
j
As
Integer
Dim
oWsh13
As
Worksheet
Dim
oWsh12
As
Worksheet
laengeEingabe = 2.5
breiteEingabe = 1.2
hoeheEingabe = 1.5
Set
oWsh13 = ThisWorkbook.Sheets(
"Tabelle13"
)
Set
oWsh12 = ThisWorkbook.Sheets(
"Tabelle12"
)
j = 2
With
oWsh12
Set
c = .Cells(j, 1)
Set
c = Range(c, c.
End
(xlDown).Offset(, 3))
c.Clear
End
With
With
oWsh13
Set
c = .Cells(j, 1)
Set
c = Range(c, c.
End
(xlDown).Offset(, 3))
c.AutoFilter
c.AutoFilter Field:=2, _
Criteria1:=Replace(
"<="
& Trim(
CStr
(
CDbl
(laengeEingabe))),
","
,
"."
), _
Operator:=xlAnd
c.AutoFilter Field:=3, _
Criteria1:=Replace(
"<="
& Trim(
CStr
(
CDbl
(breiteEingabe))),
","
,
"."
), _
Operator:=xlAnd
c.AutoFilter Field:=4, _
Criteria1:=Replace(
"<="
& Trim(
CStr
(
CDbl
(hoeheEingabe))),
","
,
"."
), _
Operator:=xlAnd
Set
specc = c.SpecialCells(xlCellTypeVisible)
c.Copy Destination:=oWsh12.Cells(2, j)
c.AutoFilter
End
With
Set
oWsh13 =
Nothing
Set
oWsh12 =
Nothing
End
Sub