range values in an array?  
Author Message
PaulofAbingdon





PostPosted: Fri Dec 16 10:35:36 CST 2005 Top

Excel Programming >> range values in an array?

Is ther an easy way to read the values of multiple cells into an array?

myArray = Range(LeftCell, RightCell) <-?

Thanks
Mike

Excel264  
 
 
Niek





PostPosted: Fri Dec 16 10:35:36 CST 2005 Top

Excel Programming >> range values in an array? myArray = Range("A1:Z1")

Or do you mean something else?

--
Kind regards,

Niek Otten



> Is ther an easy way to read the values of multiple cells into an array?
>
> myArray = Range(LeftCell, RightCell) <-?
>
> Thanks
> Mike


 
 
Mike





PostPosted: Fri Dec 16 10:50:02 CST 2005 Top

Excel Programming >> range values in an array? I am wanting to put the values from each cell in a range into an array.

Thanks
MIke



> myArray = Range("A1:Z1")
>
> Or do you mean something else?
>
> --
> Kind regards,
>
> Niek Otten
>


> > Is ther an easy way to read the values of multiple cells into an array?
> >
> > myArray = Range(LeftCell, RightCell) <-?
> >
> > Thanks
> > Mike
>
>
>
 
 
Toppers





PostPosted: Fri Dec 16 10:56:02 CST 2005 Top

Excel Programming >> range values in an array? Mike,
Further to Niek's reply (as an illustration):

Sub test()
Dim myArray As Variant
myArray = Range("a1:b20")
For r = 1 To UBound(myArray, 1)
For c = 1 To UBound(myArray, 2)
Debug.Print myArray(r, c)
Next
Next
End Sub


HTH



> I am wanting to put the values from each cell in a range into an array.
>
> Thanks
> MIke
>

>
> > myArray = Range("A1:Z1")
> >
> > Or do you mean something else?
> >
> > --
> > Kind regards,
> >
> > Niek Otten
> >


> > > Is ther an easy way to read the values of multiple cells into an array?
> > >
> > > myArray = Range(LeftCell, RightCell) <-?
> > >
> > > Thanks
> > > Mike
> >
> >
> >