Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default custom function

I have created a function for my co-workers. What I want is to make it feel
like a ready-made function, like:
1. When someone starts typing in a cell
=urpa(
in case of a readymade function one would see the arguments name in a
floating tip box. How can I do this with my custom function?
2. If someone types the function name in lowercase (like =urpa) how can I
convert it to uppercase in the function arguments forrm and formula bar?
3. How can I show helpful tips/information about arguments in the function
arguments form (like the ones for readymade functions)?

Thanks in advance.
~Asif

The function is given below, in case you'd like to see:

Function URPA(ByVal ExecAmount As Double, ExecDate As Date, Term As Byte,
IntRate As Double, Optional Mode = 1)

If ExecDate = 0 Then
URPA = "ExecDate Missing"
Exit Function
End If

Dim i As Integer
If Mode = 0 Then
i = -1
Else
i = 0
End If

Dim Rental As Double

Rental = Pmt(IntRate / 12, Term, ExecAmount, , Mode)
Rental = Abs(Application.WorksheetFunction.RoundUp(Rental, -1))
IntRate = Rate(Term, Rental, -ExecAmount, , 0)

Dim dtStep As Date
dtStep = ExecDate

Do
i = i + 1
dtStep = DateAdd("m", 1, dtStep)
Loop While dtStep < Date

If i = 0 Then
URPA = Format(ExecAmount, "##,##0")
Else
ReDim BalancePrincipal(i) As Double
ReDim Principal(i) As Double

Dim k As Integer
k = 1
BalancePrincipal(k) = ExecAmount - (Rental - ExecAmount * IntRate)

For k = 2 To i
BalancePrincipal(k) = BalancePrincipal(k - 1) - (Rental -
BalancePrincipal(k - 1) * IntRate)
Next k

URPA = Format(BalancePrincipal(i), "##,##0")

End If
End Function


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default custom function

Asif

See Laurent Longre's website for FUNCUSTOMIZE add-in.

http://longre.free.fr/english/index.html

Gord Dibben XL2002

On Sat, 29 Nov 2003 19:57:48 +0600, "Asif"
wrote:

I have created a function for my co-workers. What I want is to make it feel
like a ready-made function, like:
1. When someone starts typing in a cell
=urpa(
in case of a readymade function one would see the arguments name in a
floating tip box. How can I do this with my custom function?
2. If someone types the function name in lowercase (like =urpa) how can I
convert it to uppercase in the function arguments forrm and formula bar?
3. How can I show helpful tips/information about arguments in the function
arguments form (like the ones for readymade functions)?

Thanks in advance.
~Asif

The function is given below, in case you'd like to see:

Function URPA(ByVal ExecAmount As Double, ExecDate As Date, Term As Byte,
IntRate As Double, Optional Mode = 1)

If ExecDate = 0 Then
URPA = "ExecDate Missing"
Exit Function
End If

Dim i As Integer
If Mode = 0 Then
i = -1
Else
i = 0
End If

Dim Rental As Double

Rental = Pmt(IntRate / 12, Term, ExecAmount, , Mode)
Rental = Abs(Application.WorksheetFunction.RoundUp(Rental, -1))
IntRate = Rate(Term, Rental, -ExecAmount, , 0)

Dim dtStep As Date
dtStep = ExecDate

Do
i = i + 1
dtStep = DateAdd("m", 1, dtStep)
Loop While dtStep < Date

If i = 0 Then
URPA = Format(ExecAmount, "##,##0")
Else
ReDim BalancePrincipal(i) As Double
ReDim Principal(i) As Double

Dim k As Integer
k = 1
BalancePrincipal(k) = ExecAmount - (Rental - ExecAmount * IntRate)

For k = 2 To i
BalancePrincipal(k) = BalancePrincipal(k - 1) - (Rental -
BalancePrincipal(k - 1) * IntRate)
Next k

URPA = Format(BalancePrincipal(i), "##,##0")

End If
End Function


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default custom function

Thanks Gord!
looks like what I was looking for...

~Asif


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
custom function Steve Excel Discussion (Misc queries) 1 February 12th 09 11:20 PM
Ned Help W/ Custom Function japorms Excel Worksheet Functions 3 August 14th 06 09:58 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Custom Function Spencer Hutton Excel Worksheet Functions 2 April 29th 05 08:21 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


All times are GMT +1. The time now is 09:29 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"