Hi
A code example - maybe it helps you a bit:
Public Sub Test()
Dim MyArray() As Variant
Dim rngTest As Range
Dim RowNum As Integer
Dim ColNum As Integer
Set rngTest = [TestRange]
RowNum = rngTest.Rows.Count
ColNum = rngTest.Columns.Count
ReDim MyArray(RowNum, ColNum)
MyArray = rngTest
End Sub
TestRange is any named range, defined in workbook.

Signature
Arvi Laanemets
( My real mail address: arvi.laanemets<at>tarkon.ee )
> Hello
>
[quoted text clipped - 22 lines]
> thanks
> Charles
Charles,
What exactly are you trying to do? Do you want to create an array for each
name, and then to load that array with the contents of the name? If so, what
if the name is not a range, but say a formula, or a constant?

Signature
---
HTH
Bob
(change the xxxx to gmail if mailing direct)
> Hello
>
[quoted text clipped - 22 lines]
> thanks
> Charles
Charles - 13 Dec 2006 11:37 GMT
the thing is that the user can add some range names in the spreadsheet
and I don't want to update manually the macro grabbing all the values
each time. And for convenience of use, I am trying to use the same kind
of names in VBA arrays and XL range names (S1_Name3_Subname2 and
S1.Name3.Subname2). So basically I am trying to find a way to name a
new VBA array/variable with a name which itself is a variable
In php if the arrayname is stored in the variable $name, you can just
do $$name=....
and if $name="MyArray1", then you can directly use $MyArray1 in the
code.
not easy to describe clearly...
Charles
> Charles,
>
> What exactly are you trying to do? Do you want to create an array for each
> name, and then to load that array with the contents of the name? If so, what
> if the name is not a range, but say a formula, or a constant?