Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default custom excel function returns array, showing #VALUE in cells

On Nov 29, 4:37 pm, wrote:
On Nov 29, 3:51 pm, Gary''s Student





wrote:
Make sure you are using it as an array on the Worksheet and it has the
correct orientation:


Function demo(r As Range) As Variant
v = Array(1, 2, 3)
demo = v
End Function


Now on the worksheet, highlight A1 thru C1 and enter
=demo(Z100) and finish with CNTRL-SHFT-ENTER rather than just ENTER. You
will see:


1 2 3


If you had selected A1 thru A3 you will see:


1
1
1


because you need a transpose.
--
Gary''s Student - gsnu2007a


" wrote:
I'm using a function that returns an array of data. I put in the
function name and hit ctrl-shift_enter and every cell in my selection
gets a #VALUE.


So I thought the function might be returning bad data. I put a
breakpoint in the debugger and I can see that the array being returned
has good data. The returned type is variant/string(0 to 499, 0 to
15). I've done some spot checking and the values look fine.


How can it be that the array looks fine in the debugger but i'm
getting #VALUE back in my cells?


thanks,


Satish- Hide quoted text -


- Show quoted text -


Thanks for everyone's help but looks like I've found my answer:http://support.microsoft.com/kb/250828. I tried the same function
call in WinXP and it's fine. My function was returning more data than
excel 2000 could handle.- Hide quoted text -

- Show quoted text -


Argh I meant Excel XP, not WinXP
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
Array function that returns values within several intervals Hjuler Excel Worksheet Functions 6 September 23rd 08 04:11 PM
Redefine range of cells, array formula returns NA Ashley Excel Discussion (Misc queries) 4 February 24th 07 08:54 PM
Excel returns @name? error when using a custom written function in Al Maher Excel Programming 2 April 13th 06 01:31 PM
How to use function that returns array of variable size? [email protected][_2_] Excel Programming 3 February 13th 06 08:37 PM


All times are GMT +1. The time now is 09:45 PM.

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

About Us

"It's about Microsoft Excel"