Hello,
Few days ago I asked for a way to move rows from one sheet to another, got two methods, one with autofilter and one without,
The no-autofilter one worked for me but on a single row each time since my code is being refreshed continuesly, didnt work on multiple rows en masse, so am tryna use the AutoFilter one suggested by Mr. kevin9999
I edited it a little since my code is being refreshed and so the rows number is variable, also I used cut and delete instead of copy and delete, since cut takes the checkbox with and copy doesnt;
I faced these issues:
- Error highliting in yellow the line where i used cut property
- It cuts all the rows not only the ones containing "0" in range D
- When resizing the rows, the checkboxes below the cutted area get bugged or deformed (their tick box become smaller in appearance but the big checkbox size remain the same),
is there a way to prevent that from happening please? (like avoiding to use resize, or adding application.screen update = false or something ? idk )
Few days ago I asked for a way to move rows from one sheet to another, got two methods, one with autofilter and one without,
The no-autofilter one worked for me but on a single row each time since my code is being refreshed continuesly, didnt work on multiple rows en masse, so am tryna use the AutoFilter one suggested by Mr. kevin9999
I edited it a little since my code is being refreshed and so the rows number is variable, also I used cut and delete instead of copy and delete, since cut takes the checkbox with and copy doesnt;
I faced these issues:
- Error highliting in yellow the line where i used cut property
- It cuts all the rows not only the ones containing "0" in range D
- When resizing the rows, the checkboxes below the cutted area get bugged or deformed (their tick box become smaller in appearance but the big checkbox size remain the same),
is there a way to prevent that from happening please? (like avoiding to use resize, or adding application.screen update = false or something ? idk )
VBA Code:
Sub Move()
Dim ws1 As Worksheet, ws2 As Worksheet, lr As Long
Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")
lr1 = ws1.Cells(Rows.Count, 1).End(xlUp).Row
lr2 = ws2.Cells(Rows.Count, 1).End(xlUp).Row + 1
For i = 1 To lr1
With ws1.Cells(i).CurrentRegion
.AutoFilter 4, "0"
.Offset(1).Resize(.Rows.Count - 1, 5).cut ws2.Cells(lr2, 1) ' Error 1004 (eventhough changes are being applyied)
.Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
.AutoFilter
End With
Next i
End Sub