I have to use Excel for data analysis of .csv files of around 80-100mb. In order to speed up the process I'm trying to create a tool to automate some of this process but being as it deals with large amounts of data (approx. 500k rows) it's incredibly slow when it comes to trying to read the file initially.
Does anybody have any suggestions that I could use? I'm currently using a button for the user to select and load the file. I've put my code below for that.
Dim ws As Worksheet, fileNm As String, fileName As String
Dim FSO As Scripting.FileSystemObject
Set FSO = New FileSystemObject
Set ws = ActiveWorkbook.Sheets("CSV Data")
fileNm = Application.GetOpenFilename("CSV Files (*.csv),*.csv", , "Please select CSV file...")
If fileNm = "False" Then
Exit Sub
Else
With ws.QueryTables.Add(Connection:="TEXT;" & fileNm, Destination:=ws.Range("A1"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
End If