Thread: Array in VBA
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Array in VBA

Dim ary, i

ReDim ary(1 To 5)
For i = 1 To 5
ary(i) = i
Next i
MsgBox ary(5)

ReDim Preserve ary(1 To 6)
ary(6) = 6
MsgBox ary(5)
MsgBox ary(6)

--
HTH

Bob Phillips

"Piotr" wrote in message
...
Hi
How can I change the size of array in VBA ?
Is it possible to change static array or dynamic array ?
Please, help me.

THANKS !

Best regards,
Piotr