returns an array from function vba

The solution for “returns an array from function vba” can be found here. The following code will assist you in solving the problem.

Function arrayOfPiDigits() As Long()

‘Add parenthesis after the data type
Dim outputArray(0 To 2) As Long

outputArray(0) = 3
outputArray(1) = 1
outputArray(2) = 4

arrayOfPiDigits = outputArray

End Function

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts