Thread: Arrays
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Arrays

John,

Try something like the following:

Dim N As Long
Dim Arr() As String
N = 24
ReDim Arr(N)


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"John Brown" wrote in
message
...
Is there any way of declaring an array without putting a fixed

number? For example say I have the following
Dim number As Integer
number = 24
Dim array(number) As String.....
I need to do this because the size of the array varies

depending on how many elements I bring in from a file. Sometimes
I have 100 sometimes 40 ... is there any way to do this with VB?
Thanks in advance.