Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Argument limit on user Function?

Is there a limit on the number of arguments you can have in a user defined
Function in Excel?
--
Thanks for any help
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default Argument limit on user Function?

Yup but I do not remember what it is. Something like 40. You can pass arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user defined
Function in Excel?
--
Thanks for any help

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Argument limit on user Function?

Thanks. It's 30, because that's what I'm hitting. The error message isn't
very gooog though; it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit. Anyway, I know about arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can pass arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user defined
Function in Excel?
--
Thanks for any help

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Argument limit on user Function?

it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit.


There's a difference there?
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Argument limit on user Function?

Depends on how you look at it. It's true that the current error message,
stictly speaking, does cover hitting the argument number limit. But if you
are not aware of the limit to begin with, as in my case, you waste a lot of
time counting arguments, etc, trying to figure out what's wrong, when a
simple message saying you've hit the limit would have been infinitely more
helpful. Luckily I have enough previous programming experience that it
occured to me that there may be a limit.

"Myrna Larson" wrote:

it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit.


There's a difference there?



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Argument limit on user Function?

That seems unnecessarily trite. If you know you have too many, rather than
try to get to the number one less than the max, you look at a re-design.
Pushing to the boundaries is rarely a good idea.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Peter M" wrote in message
...
Depends on how you look at it. It's true that the current error message,
stictly speaking, does cover hitting the argument number limit. But if you
are not aware of the limit to begin with, as in my case, you waste a lot

of
time counting arguments, etc, trying to figure out what's wrong, when a
simple message saying you've hit the limit would have been infinitely more
helpful. Luckily I have enough previous programming experience that it
occured to me that there may be a limit.

"Myrna Larson" wrote:

it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit.


There's a difference there?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Argument limit on user Function?

Look up the TYPE statement in Help.

On Wed, 2 Feb 2005 17:55:07 -0800, "Peter M"
wrote:

Thanks. It's 30, because that's what I'm hitting. The error message isn't
very gooog though; it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit. Anyway, I know about arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can pass

arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user

defined
Function in Excel?
--
Thanks for any help


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Argument limit on user Function?

Thanks. I'll look it up.


"Myrna Larson" wrote:

Look up the TYPE statement in Help.

On Wed, 2 Feb 2005 17:55:07 -0800, "Peter M"
wrote:

Thanks. It's 30, because that's what I'm hitting. The error message isn't
very gooog though; it just says you are trying to pass too many arguments for
the function, instead of you've hit the limit. Anyway, I know about arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can pass

arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user

defined
Function in Excel?
--
Thanks for any help



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Argument limit on user Function?

Peter,
IMO if you are passing 30 arguments, you should look at your design again.
If it really require these 30 different pieces of information to return a
single answer, you may be trying to do too much in one function.
If you are passing 30 cell values to calculate say an average, just pass the
Range concerned.

NickHK

"Peter M" wrote in message
...
Thanks. It's 30, because that's what I'm hitting. The error message

isn't
very gooog though; it just says you are trying to pass too many arguments

for
the function, instead of you've hit the limit. Anyway, I know about

arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can pass

arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user

defined
Function in Excel?
--
Thanks for any help



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Argument limit on user Function?

Nick-

Thanks for your reply. Perhaps so. My programming experience is Fortran
(which obviously dates me), and in Fortran it is not uncommon to have a long
argument list. I would be happy to redesign if I knew how. What I am doing
is passing values in cells, say B11:B39 & B8 into a function I wrote in VB
which performs Newton-Raphson iteration and returns a single value, which is
the result of the iteration. Up to now the number of arguments I passed was
under the limit of 29. I need to be able to pass more than 29 though. How
can I pass these arguments, using the example I give above, pass B11:B39 &
B8. Also, what do I need to do to the function statement (if anything) to
receive arguments passed in an array form.

Thanks,

Peter

"NickHK" wrote:

Peter,
IMO if you are passing 30 arguments, you should look at your design again.
If it really require these 30 different pieces of information to return a
single answer, you may be trying to do too much in one function.
If you are passing 30 cell values to calculate say an average, just pass the
Range concerned.

NickHK

"Peter M" wrote in message
...
Thanks. It's 30, because that's what I'm hitting. The error message

isn't
very gooog though; it just says you are trying to pass too many arguments

for
the function, instead of you've hit the limit. Anyway, I know about

arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can pass

arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user

defined
Function in Excel?
--
Thanks for any help






  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Argument limit on user Function?

=myFunction(B11:B39,B8)

is two arguments. You have 27 left.

You have to write your function to work with multiple cells in a single
argument.

--
Regards,
Tom Ogilvy

"Peter M" wrote in message
...
Nick-

Thanks for your reply. Perhaps so. My programming experience is Fortran
(which obviously dates me), and in Fortran it is not uncommon to have a

long
argument list. I would be happy to redesign if I knew how. What I am

doing
is passing values in cells, say B11:B39 & B8 into a function I wrote in VB
which performs Newton-Raphson iteration and returns a single value, which

is
the result of the iteration. Up to now the number of arguments I passed

was
under the limit of 29. I need to be able to pass more than 29 though.

How
can I pass these arguments, using the example I give above, pass B11:B39 &
B8. Also, what do I need to do to the function statement (if anything) to
receive arguments passed in an array form.

Thanks,

Peter

"NickHK" wrote:

Peter,
IMO if you are passing 30 arguments, you should look at your design

again.
If it really require these 30 different pieces of information to return

a
single answer, you may be trying to do too much in one function.
If you are passing 30 cell values to calculate say an average, just pass

the
Range concerned.

NickHK

"Peter M" wrote in message
...
Thanks. It's 30, because that's what I'm hitting. The error message

isn't
very gooog though; it just says you are trying to pass too many

arguments
for
the function, instead of you've hit the limit. Anyway, I know about

arrays,
but what are user defined types?

"Jim Thomlinson" wrote:

Yup but I do not remember what it is. Something like 40. You can

pass
arrays
and user defined types though if you get into trouble.

"Peter M" wrote:

Is there a limit on the number of arguments you can have in a user

defined
Function in Excel?
--
Thanks for any help






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
Workaround for HYPERLINK argument length limit Dave Booker Excel Worksheet Functions 5 April 4th 23 02:22 PM
How can I get around 30 argument limit of SUM function? Randy Excel Worksheet Functions 4 May 9th 07 09:05 PM
Array as Argument in User-Defined Functions Tushar Mehta Excel Programming 0 May 19th 04 04:29 AM
Array as Argument in User-Defined Functions Harlan Grove[_5_] Excel Programming 0 May 18th 04 10:30 PM
Passing an Array of User-Defined Type to an Argument of a Function Tushar Mehta[_6_] Excel Programming 0 August 17th 03 06:43 PM


All times are GMT +1. The time now is 01:30 AM.

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"