View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] matthijsdezwart@gmail.com is offline
external usenet poster
 
Posts: 6
Default function double output

thanks!!

On 6 mrt, 16:39, "Bernie Deitrick" <deitbe @ consumer dot org wrote:
Matthijs,

Select A1:B1, type =testfunction() and press Ctrl-Shift-Enter.

HTH,
Bernie
MS Excel MVP

Function testfunction()
Dim Arr(1 To 2) As Variant
Arr(1) = "Test"
Arr(2) = 3.14
If Application.Caller.Rows.Count = 1 Then
* * testfunction = Arr
Else
* * testfunction = Application.Transpose(Arr)
End If

End Function

wrote in message

...



hi,


I cannot remember how it is called and therefore I cannot seem to find
an example on the internet.


maybe one of you can give me a hand.
I would like to make a function that has an output of two results.


for instance:
I select cells A1 and B1 type =testfunction() and then hit
CRTL_SHIFT_ENTER


then I would like to write output to A1 and other output to b1.
How can I do that?
regards,


Matthijs- Tekst uit oorspronkelijk bericht niet weergeven -


- Tekst uit oorspronkelijk bericht weergeven -