I must be missing something, but...
Why can't you just write to the array as you read the file instead of making 2 passes through it?
Use Redim Preserve inside the loop:
Code:
Open FileName For Input As #1
Do Until EOF(1)
Linecount = Linecount + 1
Redim Preserve MyArray(linecount,5)
Line Input #1, MyArray(linecount,5)
Loop
Close #1
Isn't this a good, easy way to do it? What am I missing?
Re: I must be missing something, but...
Seaweed,
The problem with that is that:
that you're rediming every line every line, which can be very slow if you have to do it a lot.
get binary is very quick to load files too
OK... So atm I'm using VBA
I am trying to adapt this code to work in VBA the problem is VBA does not like the following:
Function mySplit(strToSplt As String, strSplitOn As String) As String().
So how do I get a split function to work in VBA??? Office 97