Data Transfer Between Two Excel Workbooks

I have two sample files attached for this question, FlipperTest file is the one that needs to get data in from the ExtractionTest file.   On the FlipperTest file, on Menu tab there is Extract button.  My goal is to get the specified data values from ExtractionTest file into FlipperTest file by using the method displayed in module2 of the FlipperTest file.  

I know am missing something like file location or similar to make it work and need help with that.  The values on ExtractionTest file are in A1 to A5 and I need to get them into Retrieve tab of the FlipperTest file in row 3 under their corresponding titles.  Assume that FlipperTest file is located in FolderA and ExtractionTest file is located in FolderB.

I need to achieve this by using the below method, there should not be an option for the user to specify the file location manually via browse option and Excel should open the folder, then open the file and extract the value in the specified range.

ThisWorkbook.Worksheets("Retrieve").Cells(RL, 1).Value = Workbooks(DataFile).Worksheets("Summary").Range("A1").Value
FlipperTest.xls
ExtractionTest.xlsx
trusxlsolBusiness Systems AnalystAsked:
Who is Participating?
 
Robberbaron (robr)Commented:
Sub ExtractTasksTest()

    Dim wbDF As Workbook
    
    datafilename = "..\folderB\ExtractionTest.xlsx"
    
    Set wbDF = Workbooks.Open(Filename:=datafilename, ReadOnly:=True)
    
    
    
    ThisWorkbook.Worksheets("Retrieve").Cells(RL, 1).Value = wbDF.Worksheets("Summary").Range("A1").Value 'Development Name
    ThisWorkbook.Worksheets("Retrieve").Cells(RL, 2).Value = wbDF.Worksheets("Summary").Range("A2").Value 'Primary Address
    ThisWorkbook.Worksheets("Retrieve").Cells(RL, 3).Value = wbDF.Worksheets("Summary").Range("A3").Value 'City
    ThisWorkbook.Worksheets("Retrieve").Cells(RL, 4).Value = wbDF.Worksheets("Summary").Range("A4").Value 'Zip Code
    ThisWorkbook.Worksheets("Retrieve").Cells(RL, 5).Value = wbDF.Worksheets("Summary").Range("A5").Value  'County

End Sub

Open in new window


try this,
0
 
trusxlsolBusiness Systems AnalystAuthor Commented:
Robberbaron,

I have just solved this question now and almost the same time you have posted your solution where I was about to delete the question and re-post more involved version of it. If you could please bear with me I will post expanded version of my original question once I structure it well. Thank you!
0
 
trusxlsolBusiness Systems AnalystAuthor Commented:
Ok I guess I am good now so no any variations to this question. Thanks for the help!
0
 
trusxlsolBusiness Systems AnalystAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.