Slow copy and paste

D_Holmes

New Member
Joined
Sep 18, 2020
Messages
27
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.
 

Some videos you may like

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Zot

Well-known Member
Joined
Nov 26, 2020
Messages
973
Office Version
  1. 2016
Platform
  1. Windows
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.
 
Solution

D_Holmes

New Member
Joined
Sep 18, 2020
Messages
27
Office Version
  1. 2013
Platform
  1. Windows
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,127,301
Messages
5,623,860
Members
415,995
Latest member
SergioCM92

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
Top