View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Excel vba - passing a 3-dimensional array to a subroutine

Sub Main()
Dim variable() As Single

x = 10
y = 3
z = 3
ReDim variable(1 To x, 1 To y, 1 To z)
For i = 1 To x
For j = 1 To y
For k = 1 To z
variable(i, j, k) = i * j * k * Rnd()
Next k, j, i
Dummy variable
End Sub

Sub Dummy(v() As Single)
MsgBox v(UBound(v, 1), UBound(v, 2), _
UBound(v, 3))
End Sub


works fine for me as an illustration. What do you mean by needs a component?

--
Regards,
Tom Ogilvy

" wrote:

as shown, the variable is defined as
dim variable as single