View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default array function for multidimensional arrays

I found out that Worksheetfunction.Match does the trick!
Stefi


€˛Stefi€¯ ezt Ć*rta:

Nice trick, thanks Jay!
By the way, another question: how can I find out the order number of an
array element within an array? E.g.

rbetuk = Array("A", "B", "C")

I'd like to know that content of variable, say

XVAR="B"

is the 1st, 2nd, or 3rd element of the array. Something like

ORDERNO = Function???(rbetuk,XVAR)

This Function??? function should return 2.

Stefi


€˛Jay€¯ ezt Ć*rta:

Try using arrays themselves as arguments:

rbetuk = Array(Array("A", "B", "C"), Array("D", "E", "F"), Array("G", "H",
"I"))

You can test this by reading the array 'in' and 'out' with the following
test code:

Sub stefi()
rbetuk = Array(Array("A", "B", "C"), _
Array("D", "E", "F"), _
Array("G", "H", "I"))
For Each itm In rbetuk
For Each itm2 In itm
MsgBox itm2
Next 'itm2
Next 'itm
End Sub

--
Jay


"Stefi" wrote:

Hi All,

rbetuk = Array("A", "B", "C")

is a very convenient way of creating arrays, but it creates only a 3x1
dimension array. Can I declare a 3x2 or 3x3 dimension array in this way?


Thanks,
Stefi