Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Harry Hunter   on Oct 22 In MS Office Category.

  
Question Answered By: Nathan Evans   on Oct 22

You have to Dim the array  to start with and then ReDim it afterward.
There are some caveats to using Redim though so check the help. If
it's a one dimension array you should have no problems.

The code  should look something like

Dim slArray() as string
Dim ilArray as integer
..
..
ilArray = 20
ReDim Preserve slArray(ilArray)

.. or

ReDim Preserve slArray(Ubound(slArray)+1)

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Creation of arrays Dynamically Or get search suggestion and latest updates.


Tagged: