How to open an array?

May I know if there any method to open an array like that: 

Dim y As Duoble

............

..........

y = 7                                            '(Y finally got something)

Dim x (1 To y) As String          '<----- The problem is here

Parents
  • clever_anthony said:
    Dim y As Duoble

    First, use Option Explicit.  The VBA editor will catch typos like a mis-spelled name.

    clever_anthony said:
    Dim x (1 To y) As String

    You want an elastic array.  Look up the Redim statement in VBA help.  Hint: type Redim in your code.  Leave the cursor inside the word.  Press F1 to pop Microsoft VBA help.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • clever_anthony said:
    Dim y As Duoble

    First, use Option Explicit.  The VBA editor will catch typos like a mis-spelled name.

    clever_anthony said:
    Dim x (1 To y) As String

    You want an elastic array.  Look up the Redim statement in VBA help.  Hint: type Redim in your code.  Leave the cursor inside the word.  Press F1 to pop Microsoft VBA help.

     
    Regards, Jon Summers
    LA Solutions

Children