The below code was created with intention to autofilter column K with criteria, copy data and paste it at the bottom of the sheet on the same page, just below the last row.
I am not getting any error, but code is not working as intended. It works up to autofilter and copy, but it won't paste the data to the last row. Can I please get some assistance.
Sub Depreciation_to_Zero()
With Sheets("Restaurant")
.AutoFilterMode = False
With .Range("k1", .Range("k" & .Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:="*HotDog*"
.Offset(1).SpecialCells(xlCellTypeVisible).EntireRow.Copy
.Cells(.Rows.Count, "A").End(xlUp).Row.Select.PasteSpecial xlPasteValues
End With
.AutoFilterMode = False
End With
MsgBox ("Complete")
End Sub
I am not getting any error, but code is not working as intended. It works up to autofilter and copy, but it won't paste the data to the last row. Can I please get some assistance.
Sub Depreciation_to_Zero()
With Sheets("Restaurant")
.AutoFilterMode = False
With .Range("k1", .Range("k" & .Rows.Count).End(xlUp))
.AutoFilter Field:=1, Criteria1:="*HotDog*"
.Offset(1).SpecialCells(xlCellTypeVisible).EntireRow.Copy
.Cells(.Rows.Count, "A").End(xlUp).Row.Select.PasteSpecial xlPasteValues
End With
.AutoFilterMode = False
End With
MsgBox ("Complete")
End Sub
Last edited: