Okay, several way in which to do this but let me start at the bottom and work my way up...
Yes it is possible to redimension arrays based upon a variable value...
Dim MyArray() As Integer
Dim MyValue As Integer
MyValue = 10
ReDim MyArray(MyValue) As Integer
Debug.Print UBound(MyArray)
Now, as for accessing an excel file there are several ways. You can use ADO and treat it like a database and return your data in a recordset. See
http://www.connectionstrings.com for connection string information if you need it or you can search the www at your favorite search engine for vb6 excel and you will find many examples out there.
Good Luck
Reputation Points: 156
Solved Threads: 296
Posting Virtuoso
Offline 1,670 posts
since Mar 2009