Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
wlh wlh is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
is there any built in function to draw lines krishnan Excel Worksheet Functions 2 June 22nd 09 01:31 PM
Help to build a Look Up Function or What Ever Function Excel 2002 Carlo Excel Worksheet Functions 6 April 3rd 08 07:39 PM
Sqr built-in function in Excel 2003 VBA DaleB Excel Discussion (Misc queries) 4 October 22nd 07 05:15 PM
Excel acts as if scroll lock is on when it is not Hyehats Excel Discussion (Misc queries) 4 October 18th 05 01:33 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 05:31 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"