Copying values millions of times

RoseChapman

New Member
Joined
Jun 12, 2018
Messages
40
Hello all,

I have problems using the code below. It does the work filtering and getting the right columns however it copies the same columns millions of times up to row 1048576

Could you please help me?. Many thanks. Rose

Sub Filtering()

Dim Lastrow As Long

With Sheets("Sheet1")

If .Range("L:L").Find("*House*", , xlValues, xlWhole, , , False) Is Nothing Then
MsgBox "No ""Changed"" rows found. ", , "No Rows Copied": Exit Sub
End If

Application.ScreenUpdating = False
Lastrow = .Range("BY" & Rows.Count).End(xlUp).Row
.Range("A1:BY" & Lastrow).AutoFilter Field:=76, Criteria1:="*House*"
Intersect(.AutoFilter.Range, .Range("A:A, L:L, BX:BX")).Copy

Sheets("Paste").Range("A:R").PasteSpecial xlPasteValues, xlPasteSpecialOperationNone, False, False
.AutoFilterMode = False


With Application
.CutCopyMode = False
.Goto Sheets("Outputs").Range("A:BX")
.ScreenUpdating = True
End With

End With
End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Instead of giving us non-working code, how about telling us what you are trying to do so that we can provide you with a viable solution. Explain your issue in simple business terms as if we were standing in line at a coffee shop.
 
Upvote 0

Forum statistics

Threads
1,213,551
Messages
6,114,273
Members
448,559
Latest member
MrPJ_Harper

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top