I have been working on a project that involves importing massive amounts of data, and the way I have been doing things is just too slow. I have two column .csv files, and I have been importing them one-by-one onto a new sheet, and then copying the cells into an array using a for loop.
I would like to directly import the .csv into an array without operating on worksheet cells (they are so slow!).
I have seen a previous solution that involves copying a .csv into a two-dimensional array, but I have been just copy and pasting their code, and then writing my own code to turn it into individual arrays. Very messy, and very difficult to debug.
Load csv file into VBA array rather than Excel sheet
Does anyone have a simpler function handy? Something of the format below:
Dim myXArray(1 TO 10000) as Double
Dim myYArray(1 TO 10000) as Double
'myArray = ImportCSV(path, column)
myXArray = ImportCSV("C:\Users\Desktop\file.csv", 1)
myYArray = ImportCSV("C:\Users\Desktop\file.csv", 2)
My feeling is that someone has already done this, and by asking, I won't have to reinvent the wheel. It seems like it would be such a universally useful function.
Thanks for the help!
Michael