#1   Report Post  
Posted to microsoft.public.excel.programming
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.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA arrays Matt Excel Discussion (Misc queries) 3 February 22nd 09 06:36 PM
arrays and others.. Locachica[_3_] Excel Programming 4 December 3rd 03 09:39 PM
Arrays Colin Macleod Excel Programming 1 December 1st 03 04:32 PM
Arrays Torbjörn Steijer Excel Programming 2 November 13th 03 09:52 AM
arrays Dave B[_3_] Excel Programming 2 November 11th 03 03:32 AM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"