Hello,
I have this piece of code which allows me to select an Excel file, copy a range of data and paste it from cell A10.
I would like to modify it in order to paste data to last empty cell of column A
Can someone advise how to modify?
Thank you!
I have this piece of code which allows me to select an Excel file, copy a range of data and paste it from cell A10.
I would like to modify it in order to paste data to last empty cell of column A
Code:
Sub Get_Data_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.xls*),*xls*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:E20").Copy
ThisWorkbook.Worksheets("SelectFile").Range("A10").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Can someone advise how to modify?
Thank you!
Last edited: