I loaded a csv file as a 2-D array to memory with following code:
Sub readcsv()
Dim wbCSV As Workbook
Dim Data As Variant
Application.ScreenUpdating = False
Set wbCSV = Workbooks.Open(Filename:="C:\Users\File.csv")
With wbCSV
Data = .Sheets(1).UsedRange.Value
.Close
End With
End Sub
next step i want to search through the data and pick some. the point is that I want to do so without opening the csv itself. is there any way to search through the loaded array? I also know i-j of the intrested data in the csv. The csv uses ; as delimiter. with this code
data(i,j)
I expect to have the element in the i-j cell but it returns the nonsense string. So the question is, does vba recognise the ; as delimiter when the file is loaded in this way? or i need to arrange the loaded data into a form of a matrix and then call a specific cell?
update:
I have found that
data(i,j)
returns strange string because vba considers , as the delimiter. So for example when in the 5th row I have a;b;1,2345;c data(5,2) returns 2345;c
thanks