Hello,
I am having an issue with the following code. As i am trying to copy filtered data from one page to another and then go back to the original data page and delete the transferred data. I keep getting hung on this line with the Error 1004 Delete Method of Range Class Failed.
ActiveSheet.Range("A1" & LR).Offset(1).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
For more context here is the whole code.
Thank you in advance for any advice or help.
I am having an issue with the following code. As i am trying to copy filtered data from one page to another and then go back to the original data page and delete the transferred data. I keep getting hung on this line with the Error 1004 Delete Method of Range Class Failed.
ActiveSheet.Range("A1" & LR).Offset(1).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
For more context here is the whole code.
VBA Code:
Sub Trasfer2()
Application.ScreenUpdating = False
Dim LR As Long
ActiveSheet.Range("K1").AutoFilter Field:=11, Criteria1:="<>"
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("A2:K" & LR).SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Sheets("Closed").Select
ActiveSheet.Range("A" & Rows.Count).End(xlUp).Offset(1).PasteSpecial
Sheets("Data").Select
ActiveSheet.Range("A1" & LR).Offset(1).SpecialCells _
(xlCellTypeVisible).EntireRow.Delete
ActiveSheet.Range("A1").Select
Sheet2.ShowAllData
Thank you in advance for any advice or help.
Last edited by a moderator: