Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I build a Excel Function that acts like those built-in
I give column "A:A" a name as "Time",
so when I select column B and input an array formula as "=sin(Time)",for different "Time" values I can get according "Sin(time)" values. I want to build a function MyFunc which is more complex than "Sin" ,below is the code: function MyFunc(t as variant) as double select case typename(t) case "Range" MyFunc=MoreComplexFunc(t.Value) '#Q1:How to get the proper Array item? case else MyFunc=MoreComplexFunc(Val(t)) end select end function what is the difficulty is that if I input formula "=MyFunc(Time)" in different cells,the return values are the same. Can somebody tell me how to pass/get the proper array item value? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How can I build a Excel Function that acts like those built-in
Wlh wrote:
Can somebody tell me how to pass/get the proper array item value? case "Range" If T.Cells.Count1 Then MyFunc =MoreComplexFunc(T.Cells(Application.Caller.Row - T.Row + 1, 1)) Else MyFunc=MoreComplexFunc(t.Value) End If Bill Manville MVP - Microsoft Excel, Oxford, England No email replies please - reply in newsgroup |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
is there any built in function to draw lines | Excel Worksheet Functions | |||
Help to build a Look Up Function or What Ever Function Excel 2002 | Excel Worksheet Functions | |||
Sqr built-in function in Excel 2003 VBA | Excel Discussion (Misc queries) | |||
Excel acts as if scroll lock is on when it is not | Excel Discussion (Misc queries) | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |