Hello,

I use auto filter to filter rows.
I need to copy them to a target sheet and delete them from the source sheet.

The macro freeze on the last row ("rngCopyRangeVisible.EntireRow.Delete").

Is there a better way to do it and avoid freezing ?

Thank you for your help

Set rngCopyRange = Nothing
Set rngCopyRange = .Range(.Cells(a,b), .Cells(c,d))
        
On Error Resume Next
Set rngCopyRangeVisible = Nothing
Set rngCopyRangeVisible = rngCopyRange.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
         
'Case no visible cells in range
 If rngCopyRangeVisible Is Nothing Then
    GoTo Cont
 End If

rngCopyRangeVisible.Copy
        
Sheets(A).Cells(3, 1).PasteSpecial xlPasteValues
Sheets(A).Cells(3, 1).PasteSpecial xlPasteFormats

'Delete filtered rows 
rngCopyRangeVisible.EntireRow.Delete