Excel coding import from 1 data file to master file.

Question: Two excel files are there i.e 1 raw file & 1 master file. In both the excel files one common column. To extract data from raw file to master file using common column.

Requirement: We have to select folder & file location then using vlookup extarct data common column of master file to common column of raw file as per requirmenet of selected columns.

please help coding to automate report.

Regards,Trimal

Nick's picture

something like this:Sub

something like this:
Sub testImport()
' test the sub with an example workbook
Call ImportFiletoMaster("C:\workbook.xls")
End Sub
 
Sub ImportFiletoMaster(FilePath As String)
 
Dim myWb As Workbook
' open workbook
Set myWb = Workbooks.Open(FilePath, , True)
Sheets(1).UsedRange.Copy
 
' copy across
ThisWorkbook.Activate
Sheets("Master").Cells(Rows.Count, 1).End(xlUp).Offset(1).Select
ActiveSheet.Paste
 
' close 
myWb.close(false)
 
End Sub
- this will import the data, however, it's not entirely clear what you want to lookup, i.e from what column to what other column

Import data from raw file to Master file-VBA Coding plz help..

Thanks...

Question: Two excel files are there i.e 1 raw file & 1 master file. In both the excel files one common column. To extract data from raw file to master file using common column.

Requirement: We have to select folder & file location then using vlookup extarct data common column of master file to common column of raw file as per requirmenet of selected columns.

please help coding to automate report.

Regards,Trimal

Nick's picture

- to select the file /

- to select the file / folder, take a look here:
http://excelexperts.com/vba-tips-get-a-file-path

VBA Coding to Import data excel to excel using vlookup etc

Hi Nick,

Question: Two excel files are there i.e 1 raw excel file & 1 master excel file. In
both the excel files one common column is "F". To extract data from raw file
to master file using common column i.e Column name is "F"

Requirement: We have to select folder & file location and then using
vlookup extarct data common column "f" of master file to common column "F" of
raw file as per requirmenet of selected columns i.e Column name is N,O,P,Q,R,S,T,U &
V

Hope you understand my requirement.

Regards,
Trimal