View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Custom function to return output in multiple cells

Public Function ArrList(rng as Range)
Dim varr as Variant
Dim i as long
varr = rng.Value
for i = lbound(varr,1) to ubound(varr,1)
varr(i,1) = varr(i,1)*i
Next
ArrList = varr
End Function

select cells C1:C10

in the formula bar enter:

=ArrList(C1:C10)
end with Ctrl+Shift+Enter rather than just enter to array enter the formula.

--
Regards,
Tom Ogilvy



"Asif" wrote in message
...
I'd like to write a function that returns more than one value, which I'd
like to be displayed in multiple cells. Is it possible? If not, what's the
nearest thing I can do?