Hello everyone,
New to the site.
So I have this repetitive duty where I copy the whole sheets data from one workbook (name AMS RT AMSCOMMAND, sheet (AMS_RT_AMSCOMMAND_Universal) and paste it on to another workbook (name:Mobile Services Dashboard v4 091916(mc), sheet (Cisco Report) . I have the below code but it keeps crashing my excel. I am working with excel 2013. Here is the code that I have so far (if there is a better code I am willing to try), any help would be much appreciated.
New to the site.
So I have this repetitive duty where I copy the whole sheets data from one workbook (name AMS RT AMSCOMMAND, sheet (AMS_RT_AMSCOMMAND_Universal) and paste it on to another workbook (name:Mobile Services Dashboard v4 091916(mc), sheet (Cisco Report) . I have the below code but it keeps crashing my excel. I am working with excel 2013. Here is the code that I have so far (if there is a better code I am willing to try), any help would be much appreciated.
Code:
Sub foo3()
Dim x As Workbook, y As Workbook
Dim ws1 As Worksheet, ws2 As Worksheet
Set x = Workbooks.Open("\\cead.prd\data\USERS\PDX0\j6h068\USRDATA\Documents\Projects\DCR\AMS_RT_AMSCOMMAND_Universal Albany.xls")
Set y = Workbooks.Open("\\cead.prd\data\USERS\PDX0\j6h068\USRDATA\Documents\Projects\DCR\Mobile Services Dashboard v4 091916(mc).xls")
Set ws1 = x.Sheets("AMS_RT_AMSCOMMAND_Universal")
Set ws2 = y.Sheets("Cisco Report")
With ws1
.Cells.Copy ws2.Cells
y.Close True
x.Close False
End With
End Sub