Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function returning an array

Status
Not open for further replies.

tvala

Technical User
Mar 13, 2008
1
IT
Is it possible to write a function like this

function(matrix(,) as array)as array
i.e. a function that takes a multidimensional array as argument and returns an array.
Also how do you input the values of the argument array?
Thanks
 
Yeah, no problem, something like:
Code:
Function Matrix2(vStrArray() As String) As String()
' play with array
End Function

' A quick example if using it...

Dim strTest(2, 2) As String
Dim strings() As String

strTest(1, 2) = "Test"

strings = Matrix2(strTest)
Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
tvala - I'd like to double-check whether you're talking about input and output "arrays" being vba arrays or spreadsheet "arrays". (some people call worksheet functions like mmult "array functions")
 
Same question few threads earlier: thread707-1458492.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top