Hi All, just hoping someone can help. I pretty simple when it comes to vba, i generally look online a find the code and adjust to make it work. I'm trying to use GetOpenFile.
I'm hoping to open a box with all csv file from a specific folder but atm I'm unable to workout how to do that..(the specific folder part)
So far this is what I've done, it works, but hoping to get can help on how I adapt so it only opens a specific folder holding numerous csv files. The folder name is CSV_ALL
I'm hoping to open a box with all csv file from a specific folder but atm I'm unable to workout how to do that..(the specific folder part)
So far this is what I've done, it works, but hoping to get can help on how I adapt so it only opens a specific folder holding numerous csv files. The folder name is CSV_ALL
VBA Code:
Sub Get_Data_From_File()
Dim FileToOpen As Variant
Dim OpenBook As Workbook
FileToOpen = Application.GetOpenFilename(Title:="Browse for your File & Import Range", FileFilter:="Excel Files (*.csv*),*csv*")
If FileToOpen <> False Then
Set OpenBook = Application.Workbooks.Open(FileToOpen)
OpenBook.Sheets(1).Range("A1:g785").Copy
ThisWorkbook.Worksheets("Red").Range("A3").PasteSpecial xlPasteValues
OpenBook.Close False
End If
Application.ScreenUpdating = True
End Sub
Last edited by a moderator: