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:="Text Files (*.csv*),*csv*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:V45").Copy
Range("T1").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
I am importing a CSV file to cell T1 on a worksheet. But when i copy that worksheet and move it to the end and try to use the button it copies it back to the other worksheet. The data is race results from an iracing csv file. My apologies in advance i am new to VBA and still trying to learn things. I would like to make a default sheet and then just copy it to the end and have it work the active worksheet.
Dim FileToOpen As Variant
Dim OpenBook As Workbook
Application.ScreenUpdating = False
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Text Files (*.csv*),*csv*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:V45").Copy
Range("T1").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
I am importing a CSV file to cell T1 on a worksheet. But when i copy that worksheet and move it to the end and try to use the button it copies it back to the other worksheet. The data is race results from an iracing csv file. My apologies in advance i am new to VBA and still trying to learn things. I would like to make a default sheet and then just copy it to the end and have it work the active worksheet.