Hello,
I want to declare an array such as:
MyArray(1 to N)
Where I read in N from the spreadsheet. The compiler tells me that N must be a 'Const' but in that case, i can't seem to let N read in a value from the sheet.
Any ideas?
Thanks!!
Hello,
I want to declare an array such as:
MyArray(1 to N)
Where I read in N from the spreadsheet. The compiler tells me that N must be a 'Const' but in that case, i can't seem to let N read in a value from the sheet.
Any ideas?
Thanks!!
Hi there,
Try ReDim:
Hope that helps,Option Explicit Sub exa() Dim x As Long Dim ary() As Long x = 3 ReDim ary(1 To x) As Long ary(1) = 23 ary(2) = 321 ary(3) = 213 End Sub
Mark
Perfect, thank you very much!