open multiple sheets form given path and paste as it is in wokring file

manoj_arsul

Board Regular
Joined
Jun 27, 2018
Messages
61
I have below code , but its not working can any one help me.

Sub UpdateLinks()
Dim wbSource As Workbook
Dim wbDestination As Workbook
Dim wbSource1 As Workbook
Dim wbDestination1 As Workbook
Dim wbSource2 As Workbook
Dim wbDestination2 As Workbook
Dim wbSource3 As Workbook
Dim wbDestination3 As Workbook


Set wbSource = Workbooks.Open(Filename:="Z:\Desktop\IBM\SOC\SA&D WO Task\July'18\16th July\WIP.csv")
Set wbDestination = Workbooks("July'18_SA&D WO Task Report.xlsm")
Set wbSource1 = Workbooks.Open(Filename:="Z:\Desktop\IBM\SOC\SA&D WO Task\July'18\16th July\Assigned.csv")
Set wbDestination1 = Workbooks("July'18_SA&D WO Task Report.xlsm")
Set wbSource2 = Workbooks.Open(Filename:="Z:\Desktop\IBM\SOC\SA&D WO Task\July'18\16th July\Pending.csv")
Set wbDestination2 = Workbooks("July'18_SA&D WO Task Report.xlsm")
Set wbSource3 = Workbooks.Open(Filename:="Z:\Desktop\IBM\SOC\SA&D WO Task\July'18\16th July\Closed.csv")
Set wbDestination3 = Workbooks("July'18_SA&D WO Task Report.xlsm")



wbSource.Sheets("WIP").Range("A:P").Copy
wbDestination.Sheets("WIP").Range("A1").Paste (xlPasteValues)
Application.CutCopyMode = False
ActiveWorkbook.Save
Workbooks("WIP.csv").Close SaveChanges:=False

wbSource1.Sheets("Assigned").Range("A:Q").Copy
wbDestination1.Sheets("Assigned").Range("A:Q").Paste (xlPasteValues)
Application.CutCopyMode = False
ActiveWorkbook.Save
Workbooks("Assigned.csv").Close SaveChanges:=False

wbSource2.Sheets("Pending").Range("A:Q").Copy
wbDestination2.Sheets("Pending").Range("A:Q").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
ActiveWorkbook.Save
Workbooks("Pending.csv").Close SaveChanges:=False

wbSource3.Sheets("Closed").Range("A:Q").Copy
wbDestination3.Sheets("Closed").Range("A:Q").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
ActiveWorkbook.Save
Workbooks("Closed.csv").Close SaveChanges:=False


End Sub
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,223,896
Messages
6,175,263
Members
452,627
Latest member
KitkatToby

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