I need to assign one array to another. Here's my problem. I have a function that returns an array of email addresses. I want to assign this to another array like so:
Dim EmailList EmailList = ReturnEmailArray
Function ReturnEmailArray Dim eArray() ... create email array here ...
ReturnEmailArray = eArray End Function
I am getting an error. Why? How can I do this problem?
I notice however that you are using a dynamic array, are you initialising said array with a ReDim? To be honest, I hardly ever use dynamic arrays as I've found that simply creating an array with more than enough elements is more performant (and, yes, lazy I know). So, if I know that roughly I'll need 500 elements I'll Dim the array with 600 or so. I can always Redim Preserve it with the Ubound limit of the array if I need to get rid of the unused elements.