Slow copy and paste

D_Holmes

New Member
Joined
Sep 18, 2020
Messages
32
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

I wrote this code and before it ran without too much delay, however now it takes an extreme amount of time to copy/paste from one sheet to another. Could someone please let me know how I can make it more fluid?

Here is the code:

VBA Code:
Sub Filter_Content()

Application.ScreenUpdating = False

Worksheets("Filtered Data").Range("a2:R15000").ClearContents
Worksheets("Current Disaster Report").Select
Range("A1").Select

'paste HCH HCH 5TH NURSE
With Worksheets("Current Disaster Report")
   .Range("A1:R1").AutoFilter Field:=14, Criteria1:="HCH HCH 5TH NURSE"
   .AutoFilter.Range.Offset(0).Copy
    Worksheets("Filtered Data").Range("a1").PasteSpecial Paste:=xlPasteAll
    Application.CutCopyMode = False
End With

Worksheets("Dashboard").Select

Worksheets("Data Information").Visible = xlSheetVeryHidden
Worksheets("Filtered Data").Visible = xlSheetVeryHidden
Worksheets("Current Disaster Report").Visible = xlSheetVeryHidden

MsgBox "Content Filtered ^__^"

End Sub

There are 16 other filters I am copying and then pasting to the same sheet.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Try add
Application.Calculation = xlCalculateManual in the beginning like after Application.ScreenUpdating = False
At the end reset back to Application.Calculation = xlCalculationAutomatic

Note that if your program crashed midway, the calculation will stay at manual.
 
Upvote 0
Solution
Try add
Application.Calculation = xlCalculateManual in the beginning like after Application.ScreenUpdating = False
At the end reset back to Application.Calculation = xlCalculationAutomatic

Note that if your program crashed midway, the calculation will stay at manual.
Perfect! Worked like a charm. Thank you!
 
Upvote 0

Forum statistics

Threads
1,214,788
Messages
6,121,580
Members
449,039
Latest member
Arbind kumar

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