View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Neal Zimm Neal Zimm is offline
external usenet poster
 
Posts: 345
Default Array function, two dimensions?? and worksheet arrays

As always Tom,
Concise, to the point, clever and accurate.
Thanks.
How can I get in touch with you outside of this bulletin board?
Snail mail or otherwise?
Many Thanks,
--
Neal Z


"Tom Ogilvy" wrote:

Q1) Can you 'do' exampleA in two dimensions?
No

You can do an array of arrays to simulate two dimensions, but you can't
create a two dimensional array in one command using the Array function.

You can do

Dim A as Variant
A = Evaluate("{1,2,3;4,5,6;7,8,9;10,11,12}")

will initialize a 4 x 3 array

Q2) the Excel text for example A says that 10,20,30 arglist are values.
Can what's inside the parenthesis be variable names containing values?
Yes
demo'd from the immediate window
f = 3
j = ll
h = 12
A = Array(f, j, h)
? a(2)
12
? a(0)
3


Q3) New topic:
I can't seem to find an example of how to specify an array of cells
for worksheet formulas (NOT a vba array)
will you provide a brief example?

ActiveCell.Formula = "=Sum(A1:A10,C1:C10)"

or
set rng = Range("A1:A0,C1:C10")
ActiveCell.Formula = "=Sum(" & rng.Address & ")"


--
Regards,
Tom Ogilvy


"Neal Zimm" wrote in message
...
Hi

example A
Dim A As Variant
A = Array(10,20,30)
B = A(2)
the above is straight from Excel help on array functions.

If have used two dimension arrays like this befo
example B
dim stuff(20,20) as integer

where stuff( var1, var2) gets me to where I want.

Q1) Can you 'do' exampleA in two dimensions?

Q2) the Excel text for example A says that 10,20,30 arglist are values.
Can what's inside the parenthesis be variable names containing

values?

Q3) New topic:
I can't seem to find an example of how to specify an array of cells
for worksheet formulas (NOT a vba array)
will you provide a brief example?

Thanks much,

--
Neal Z