Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a maximum number of parameters to a function in excel 2003?

Status
Not open for further replies.

mrbud1972

Instructor
Aug 26, 2003
43
GB
Hi, I have a user who has a function say :
Function Calculate_values (param1,Param2,param3,param4,...etc)
Everything works fine until more than 12 parameters are entered. Is there a maximum? can't find any mention anywhere. Just need to explore the obvious first. Any help greatly appreciated.
Thanks
Martin.
 
The limit of arguments depends on application you use. In VBA 6.3 (office xp), pure VBA>VBA, I worked well with 80 args without any problem. In an excel spreadsheet the limit is 29. Do not think that this less in 2003.

You can pass variable number of arguments either by using 'Optional' keyword in function definition (in fact, the not defined ones are handled by function body in that case) or use 'ParamArray' keyword. I would rather search here, probably the number of arguments was limited within the function.

combo
 
You'd be better off posting this in the VBA forum. But in the meantime, I have a question ... you say
Everything works fine until more than 12 parameters are entered.
but you DON'T say what happens when more than 12 parameters are entered! So, what happens? Do you get a compile error? Or a runtime error? Or just unexpected results?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Thanks for the efforts so far. When more than 12 parameters are entered the function fails to work at all. It doesnt produce any results. No error message is generated. Ive asked the user to debug looking at the parameters to see if values are passed into them. Meanwhile any further input is greatly appreciated. Thanks
Martin.
 
new development. It would appear the maximum we have come up against is 15 parameters each with aprox 18 characters for each parameter. Is there a maximum total length per function? thanks.
 
If you look up "Excel specifications and limits" in the on-line help, the "Calculation" tab shows a limit of 30 parameters for a function and 1024 characters for a formula.
 
Post the code behind the function.

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top