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
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