Option
Explicit
Sub
RecordIt()
With
Sheets(
"Montagebericht"
)
MkListFilter .Range(
"B1"
).Value, .Range(
"E3"
).Value, .Range(
"B4"
).Value, .Range(
"B5"
).Value, .Range(
"B11"
).Value,
"delivered"
End
With
End
Sub
Private
Sub
MkListFilter(
ByVal
Md
As
String
,
ByVal
FS
As
String
, _
ByVal
FrmNbr
As
Variant
,
ByVal
SysNbr
As
Variant
,
ByVal
Dte
As
Variant
,
ByVal
State
As
String
)
Dim
Rw
As
Range
With
Sheets(
"Lagerbestand"
)
With
.ListObjects(1)
.AutoFilter.ShowAllData
With
.Range
.AutoFilter Field:=2, Criteria1:=Md
.AutoFilter Field:=3, Criteria1:=FS
.AutoFilter Field:=4, Criteria1:=
"storing"
End
With
Set
Rw = .DataBodyRange.SpecialCells(xlCellTypeVisible).Rows(1)
Do
Until
Rw.Cells(8) =
""
And
Rw.Cells(7) =
""
Set
Rw = Rw.Offset(1)
Loop
Rw.Cells(8).Value = SysNbr
Rw.Cells(7).Value = FrmNbr
Rw.Cells(5).Value = Dte
Rw.Cells(4).Value = State
.AutoFilter.ShowAllData
End
With
End
With
End
Sub