Easy User Defined Function Question

jonesy241

Board Regular
Joined
Dec 16, 2004
Messages
174
I'm writing a user defined function and have it calculating properly.
I would like to have the variable requirements shown as the user is typing the formula like when you start typing "=if(" a yellow box appears below the formula bar with "IF(logical_test,[value if true],[value if false])"

How do I get that to appear for my UDF.

Thanks!

Paul

Code:
Public Function ExpPlacement(Paybox As Range, Paygrade As Integer, _
    Current_Years_Experience As Integer, Spread_Years As Integer)

Next_Years_Experience = 1 + Current_Years_Experience

If Current_Years_Experience + 1 >= Spread_Years Then
    ExpPlacement = WorksheetFunction.VLookup(Paygrade, Paybox, 3, False)

Else

ExpPlacement = ((WorksheetFunction.VLookup(Paygrade, Paybox, 3, False) _
    - WorksheetFunction.VLookup(Paygrade, Paybox, 2, False)) / Spread_Years _
    * Next_Years_Experience) + WorksheetFunction.VLookup(Paygrade, Paybox, 2, False)

End If

End Function
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

Forum statistics

Threads
1,191,131
Messages
5,984,850
Members
439,920
Latest member
mejatom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top