select function arguments in runtime

F

frankgtl

Hi
I am working on a user defined function in Excel, and am wondering if it is
possible to select what arguments to use in a function when the file is
opened.
I am thinking something like:

if c1= "Yes" then argument a is to be used - here_: "Yes"
if c2= "Yes" then argument b is to be used - here_: "No"
if c3= "Yes" then argument c is to be used - here_: "Yes"
if c4= "Yes" then argument d is to be used - here_: "Yes"

Function (a as string, c as string, d as string)
.....
 
J

Joel

There is a good write up in the VBA help using the following

Understanding Named and Optional Arguments

Paste entire line above into the VBA help.

Also to determine if a variable isn't use look at VBA help

IsMissing Function

Again copy the above line into the VBA help
 

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