Writing UDF Help

J

jlclyde

I am trying to write a UDF but I am unsure how to request multiple
arguments of the same type? I am looking for something similar to how
the Sum or the average looks. You can select multiple ranges or cells
and it just gives you another number. Number1, Number2,
Number3...Number30. How is this accomplished?

Thanks,
Jay
 
R

Ron Rosenfeld

I am trying to write a UDF but I am unsure how to request multiple
arguments of the same type? I am looking for something similar to how
the Sum or the average looks. You can select multiple ranges or cells
and it just gives you another number. Number1, Number2,
Number3...Number30. How is this accomplished?

Thanks,
Jay

Look at the Optional and ParamArray keywords.
--ron
 
N

Niek Otten

HI Jay,

You can specify arguments to be Optional.

In the VB Editor, type Function Test(a, optional b)
With the cursor in the word Optional, press F1 and follow the threads to Optional arguments

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

|I am trying to write a UDF but I am unsure how to request multiple
| arguments of the same type? I am looking for something similar to how
| the Sum or the average looks. You can select multiple ranges or cells
| and it just gives you another number. Number1, Number2,
| Number3...Number30. How is this accomplished?
|
| Thanks,
| Jay
 
N

Niek Otten

<I don't know if Excel 2007 has provided a good way for you to define help for a UDF.>

Unfortunately, No.

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| I'm not sure if you want help writing the UDF itself, or if you have a UDF
| and want to create help text for it for users. Niek answered the former; this
| is all the help I can give on the latter:
|
| This link may be helpful to you:
| http://www.dicks-blog.com/archives/2006/02/17/registering-a-user-defined-function-with-excel/
|
| I don't know if Excel 2007 has provided a good way for you to define help
| for a UDF.
|
| Hope this helps,
|
| Hutch
|
| "jlclyde" wrote:
|
| > I am trying to write a UDF but I am unsure how to request multiple
| > arguments of the same type? I am looking for something similar to how
| > the Sum or the average looks. You can select multiple ranges or cells
| > and it just gives you another number. Number1, Number2,
| > Number3...Number30. How is this accomplished?
| >
| > Thanks,
| > Jay
| >
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top