View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Matt Jensen Matt Jensen is offline
external usenet poster
 
Posts: 113
Default Dynamic array problem

very nice!
Cheers
Matt

"Tom Ogilvy" wrote in message
...
with Worksheets("myName")
myArray = Intersect(.UsedRange.EntireRow, .Range("A:E")).Value
End with

--
Regards,
Tom Ogilvy

"Matt Jensen" wrote in message
...
Howdy
I've defined a dynamic array

dim myarray() as variant
dim myvar as int
myvar =Worksheet("myname").UsedRange.Rows.Count
redim myarray(1 to myvar, 1 to 5)
myarray = Worksheet("myname").UsedRange.Value

Why then, when the usedrange is actually 4 columns wide (& 1 row deep)

and
the 5th column is empty, does
UBound(myarray, 2) = 4
???
Doesn't that defy the whole point of dimensioning the array?

What am I missing?
Thanks
matt