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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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
Back
Top