Return an array from a VBA function -


i have following code:

public function model(s string) string()     s = replace(replace(s, "-", ","), " ", "")     model = split(s, ",") end function 

which should take s string, example:

s = "031, 603-604, 803-804, 617, 817, 619, 819, 621, 821, 627, 827, 629, 829, 831, 645-646, 845-846, 647-648, 847-848, 649-650, 849-850, 667-668, 867-868, 671-672, 871-872, 677-678, 675-676, 875-876, 679-680" 

and make array of codes (models) based upon it. want call in way:

sub irrelevant()     dim s string     s = <similar string above, directly input worksheet cell>     tmparr = model(s)      dim ictr long     ictr = 0 ubound(tmparr)         debug.print tmparr(ictr)     next end sub 

this throws me error on tmparr = model(s) line:

compile error: expected array