I want to build function in VBA that build an array and return it to array that's in another sub so I can use this function in multiple places. For example:
Sub getArrayData ()
Dim myItemsArr() As String ' dynamic array
myItemsArr = functionToFillArray
End sub
And let's assume this is the function
Function functionToFillArray(arrayIWantToFill as Variant)
arrayToFill = ("A","B","C")
arrayIWantToFill = ???
functionToFillArray = ?? ' what should i do here to return the array i want to fill
End function
At other language suck as Java its more clear to me how to do it, but in VBA I just don't understand how its work yet. I try to find some information online, but without success