I did post in another thread and was given this basic outline to use, but I cant quite get my mind into Excel mode, can anyone help?
Sub import_data()
Dim i As Long, _
next_row As Long, _
master_wkb As Workbook, _
form_wkb As Workbook, _
SRfilenames As Variant, _
fileindex As Integer, _
filename As String
Set master_wkb = Workbooks(ThisWorkbook.Name)
master_wkb.Sheets("Data").Range("2:" & Rows.Count).Delete
'Select files
SRfilenames = Application.GetOpenFilename( _
fileFilter:="Excel,*.xls", _
Title:="Select one or more import files", _
MultiSelect:=True)
Application.ScreenUpdating = False
'Loop through selected files
If Not IsArray(SRfilenames) Then Exit Sub
For fileindex = LBound(SRfilenames) To UBound(SRfilenames)
filename = SRfilenames(fileindex)
Workbooks.Open (filename)
Set form_wkb = Workbooks(ActiveWorkbook.Name)
master_wkb.Activate
'*******
'*******
'actual import goes here... the code here depends on the arrangement of your input
'files and desired layout for your master workbook
'*******
'*******
form_wkb.Activate
form_wkb.Close saveChanges:=False
Next fileindex
Application.ScreenUpdating = True
End Sub
http://www.mrexcel.com/forum/showthr...59#post1687659
Bookmarks