Hi Everyone, I would like to modify the code below to paste the imported datas at a defined place (eg starting in C3), not at the end pf the UsedRange but I am not able to modify the code (line underlined). Any idea? Thanks for your help.
Rgds, Frankie
Sub ImportXLS()
sFileImport = Application.GetOpenFilename("Excel-files, *.xls", 1, "Select file to import", , False)
If TypeName(sFileImport) = "Boolean" Then
'No file selected
Else
With Workbooks.Open(sFileImport)
With .Sheets(1).UsedRange
ThisWorkbook.Sheets(1).Cells(Rows.Count, 1).End(xlUp).Offset(1).Resize(.Rows.Count, Columns.Count) = .Value
End With
.Close False
End With
End If
End Sub
Bookmarks