View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Gary Keramidas Gary Keramidas is offline
external usenet poster
 
Posts: 2,494
Default need some array help

got it worked out by redimming after i know how many elements i need.

thanks

--


Gary


"Rick Rothstein (MVP - VB)" wrote in
message ...
When you use the Preserve keyword, you can only change the size of the last
dimension. This is discussed in the help files for the ReDim statement.

Rick


"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
i want to store an unknown number variables in a 2 dimensional array and
can't figure out how to use redim preserve

here's what i tried

dim arr() as string

redim arr(1 to 1, 1 to 6)

for n = 1 to itemnum.count
ReDim Preserve arr(1 To n, 1 To 6)
then code to add a values
next

on the 2nd loop i always get an error
can someone enlighten me please?
--


Gary