Hello:
Please refer to attached sheets.
I need a VB Code to perform following.
Dated data files will be in C:\Temp\ddmmyy_Sales_PLU.xls
Currently i have file : 050115_Sales_PLU.xls
I need to extract data from 050115_Sales_PLU.xls and paste in Book1.xls as shown
Join data from column E and F and put in column A
I have manually pasted as an example.
Please let me know if you have any questions.
Thanks.
Note :
I have tried writing the code as below but it is giving error.
Sub ExtractData()
Dim ClosedWkb As Variant
Dim ColsCnt As Long
Dim RowsCnt As Long
Dim SrcRng As Range
Dim xl As New Excel.Application
Dim xlW1 As Excel.Workbook
Dim x2 As New Excel.Application
Dim x2w2 As Excel.Workbook
Dim FilePath1 As String
Set wshTarget = ActiveSheet
FilePath1 = "C:\Temp\"
ClosedWkb = FilePath1 & "050115 RSA_Menu Mix By Major Minor Detail" & ".xls"
Stop
Application.ScreenUpdating = False
Set x1w1 = xl.Workbooks.Open(ClosedWkb)
Stop
Set SrcRng = xlW1.Sheets("Sheet1").Range("E5:E34")
ColsCnt = SrcRng.Columns.Count
RowsCnt = SrcRng.Rows.Count
wshTarget.Range(A & "1").Resize(RowsCnt, ColsCnt) = SrcRng.Value
x1w1.Close False
' free memory
Set x1w1 = Nothing
Set x1 = Nothing
End Sub
Riz
Bookmarks