ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select function arguments in runtime (https://www.excelbanter.com/excel-programming/424523-select-function-arguments-runtime.html)

frankgtl

select function arguments in runtime
 
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)
.....



joel

select function arguments in runtime
 
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

"frankgtl" wrote:

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)
.....





All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com