Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Pass named range to user defined function returns #value!

Are you sure =qty*price gives you what you expect. In my system it just
multiplies the first items of each range, that is A1*B1, which cannot be
what you expect.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"IneedHelp" wrote in message
...
If I pass a named range as a parameter to a user defined function, it
returns
#value!

I created several named ranges.
For Example
A1:A100 is qty
B1:B100 is price

If I enter qty * price in colum C, the results are as I expect. However,
when I attemp to pass the named range to a user defined function, it
returns
#value! and debug.print inside by UDF yields no value.

For example: MyFunction(qtyIn, priceIn) returns #Value!

Public Function MyFunction(qtyIn, priceIn)
debug.print qtyIn

MyFunction = qytIn * priceIN
End function

I have experience using VBA but am new to using VBA in Excel.



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
User defined function returns imprecise value when used in worksheet JohnM[_3_] Excel Discussion (Misc queries) 3 December 1st 09 12:52 PM
Pass named range to user defined function returns #value! JMB Excel Programming 1 November 10th 07 12:24 PM
Passing a named range into a user defined function Simon Shaw Excel Programming 2 March 15th 05 09:33 PM
User Defined Function used in Macro returns #VALUE hodler Excel Programming 1 July 30th 04 03:46 AM
passing named range to a UDF user defined function Brian Murphy Excel Programming 3 June 13th 04 08:38 PM


All times are GMT +1. The time now is 05:54 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"