View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default extracting a subset of an array with VBA.

You might want to consider the SubArray function in the freely
downloadable file at http://home.pacbell.net/beban.

Alan Beban

y wrote:

Hi all,

I need to extract an array from another. The dest array will
contain,e.g., the even elements of the first one.

Which code of VBA could help me?
I've thought something this

Function Subset (source As range) As ? (I don't know, I need an array,
not a range)
... my algorithm ...
End Function

This function will be called in a cell as an argument inside several
Excel functions.
Could someone tell me how can I return an array? Do I have to take care
about some troubles in
particular in building this function?

Thanks in advance,
Alex.