Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default function double output

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
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 -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Output of the =IF(COUNTA) Function Excel Helps Excel Worksheet Functions 2 January 21st 08 12:30 PM
VBA - Function Output Jeff Excel Discussion (Misc queries) 2 March 30th 07 07:53 PM
displaying output of a formula to be in double quotes Mike Scala Excel Worksheet Functions 7 January 23rd 07 06:11 PM
Array as output of function maca Excel Programming 4 July 15th 05 12:59 PM
UDF, Array function, vertical output Robin Hammond[_2_] Excel Programming 2 September 30th 04 05:23 AM


All times are GMT +1. The time now is 05:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"