vba - How to call a function passing only one optional argument? -
If my function looks
function (optional byval string1, optional as string Byval string2 as string, alternate byval string3 as string; and I enter "= function (string3)" by simply entering string3 I want to call function by entering in the cell, how can I do this?
It is possible in one of two ways ..
- Routine Call and identify which type of optional parameter is being used to "skip" unusual params:
function MyFunc (optional, an integer, _ optional integer As B, alternate as integer C) double MyFunc = c * 3.14159 end function = MyFunc (, 12) & lt; == Call your function in a worksheet or VBA module called function MyFunc (Args) Variation in the form of a double digit number as the double dim number of the formar rgr variant of the eye, such as the integer de i in the form of double number oophagues = ebongs (args) i = 1 in Argus debug for each RG. Print "Arg (" & amp; I & amp; ") =" & Amp; Arg Reply = Int (RGR) * 3.14159 i = i + 1 Next ARG MyFunc = Answer Closing Function sub test1 () Dim parms () Command 'redhead' (1 to 3) as' params (1) = ?? 'Params (2) = ?? Param (3) = 21 Debug. Print MyFunc (Parameters) and Sub
Comments
Post a Comment