Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Hi,
If you look at the ordinary =SUM() function, this takes two types of input: Numbers and ranges. I.e., you can either write =SUM(A1:C3) or =SUM(1,2,3) I would like to create an UDF which accepts the same, but how to define the input type??? If I do this: Function UDF(ValueRange as Range) ....it will only accept range as input, and not numbers??? Help appreciated, please? CE |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Charlotte E. wrote:
If you look at the ordinary =SUM() function, this takes two types of input: Numbers and ranges. I.e., you can either write =SUM(A1:C3) or =SUM(1,2,3) I would like to create an UDF which accepts the same, but how to define the input type??? If I do this: Function UDF(ValueRange as Range) ...it will only accept range as input, and not numbers??? Help appreciated, please? ParamArray: Function foo(ParamArray x() As Variant) The ParamArray variable must be a Variant array, there can only be one ParamArray, and it must be the last arg. Check the type of each member of x() with VarType to see what you're dealing with. -- Don't any of your street demons have real grown-up names? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
That was quick :-)
Thanks... CE Den 31.01.2012 08:53, Auric__ skrev: Charlotte E. wrote: If you look at the ordinary =SUM() function, this takes two types of input: Numbers and ranges. I.e., you can either write =SUM(A1:C3) or =SUM(1,2,3) I would like to create an UDF which accepts the same, but how to define the input type??? If I do this: Function UDF(ValueRange as Range) ...it will only accept range as input, and not numbers??? Help appreciated, please? ParamArray: Function foo(ParamArray x() As Variant) The ParamArray variable must be a Variant array, there can only be one ParamArray, and it must be the last arg. Check the type of each member of x() with VarType to see what you're dealing with. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Adding to Auric's suggestion...
Function UDFname(Rng As Range, Nums as Variant, Text As String) ...and so on for as many inputs as you want/need for the task. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Charlotte E. wrote:
That was quick :-) Thanks... Easy answers are fast answers. ;-) Now ask a hard one. -- - Hercules. Why does that name ring a bell? - I don't know. Um, maybe we owe him money? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Now ask a hard one. How to get Microsoft to trash those ¤%%#¤¤%#¤% ribbons, and go back to menus and toolbars?!? :-) |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Charlotte E. wrote:
Now ask a hard one. How to get Microsoft to trash those ¤%%#¤¤%#¤% ribbons, and go back to menus and toolbars?!? I said "hard", not "impossible". -- Give the laws of physics time to cry alone in the corner. |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
UDF: More than one input type?
Charlotte E. laid this down on his screen :
Now ask a hard one. How to get Microsoft to trash those ¤%%#¤¤%#¤% ribbons, and go back to menus and toolbars?!? :-) You do know that J-Walk has a macro available that puts all the old menus on the Addins tab so you have both, ..right? -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I can't input anything I type on Excel. What can I do? Nothing p. | Excel Worksheet Functions | |||
error 13 type mismatch input box | Excel Discussion (Misc queries) | |||
Input Box - Type mismatch | Excel Programming | |||
Type mismatch using rnge as Range with Type 8 Input Box | Excel Programming | |||
Input box Type:= 8 not working | Excel Programming |