VBA Copy and Paste help

redskinsfan

New Member
Joined
Aug 11, 2006
Messages
10
I am currently trying to cut and paste sheet 1 of one workbook to sheet 2 of another workbook. The code I am using works, but it takes a VERY long time to accomplish this simple taks. Is there a more efficient way of doing this? Thanks in advance.

Code:
Windows(ExclusionName & ".xls").Activate
    Cells.Select
    Selection.Copy
    Windows(FileName & ".xls").Activate
    Sheets("All SPIDs by Scorecard").Select
    ActiveSheet.Paste
    Sheets("Score Distribution by SPID & Scorecard").Select
    Windows(ExclusionName & ".xls").Activate

Like i said before this works, but takes over a minute. (It's quicker to do it manually.) Any suggestions?
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,300
Office Version
  1. 365
Platform
  1. Windows
That code can be cleaned up.
Code:
Workbooks(ExclusionName & ".xls").ActiveSheet.Cells.Copy Workbooks(FileName & ".xls").Sheets("All SPIDs by Scorecard").Range("A1")
I don't know if that will speed up the operation, I think the slowness is caused because you are copying every cell.
 

Forum statistics

Threads
1,136,369
Messages
5,675,360
Members
419,565
Latest member
Phil57

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