View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default function double output

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