Results 1 to 2 of 2

Display Hints in User Defined Function

Threaded View

  1. #1
    Registered User
    Join Date
    10-16-2020
    Location
    Colombia
    MS-Off Ver
    2016
    Posts
    1

    Post Display Hints in User Defined Function

    Good afternoon.

    I'm new to VBA programming and I'm learning how to create user defined functions. I've created a user defined function (The function is called "Quadratic") that calculates the roots of a square function ax˛+bx+c=0 and recieves as inputs the numbers a, b and c, however, when I use the function in excel and I write in a cell "=QUADRATIC(" I would like to see these little hints that appears like "a;b;c" to know which are the parameters that I have to put in each argument of the function. I would like to know if someone could help me about this questions please? I attach the code here:


    Public Function QUADRATIC(a As Variant, b As Variant, c As Variant) As Variant
    Dim ANS(1) As Variant
    Dim Discriminant As Variant
    Discriminant = ((b ^ 2) - 4 * a * c)
    If Discriminant >= 0 Then
    ANS(0) = (-b + (b ^ 2 - 4 * a * c) ^ (1 / 2)) / (2 * a)
    ANS(1) = (-b - (b ^ 2 - 4 * a * c) ^ (1 / 2)) / (2 * a)
    QUADRATIC = ANS
    End If
    If Discriminant < 0 Then
    ANS(0) = Application.WorksheetFunction.Round((-b / (2 * a)), 3) & "+" & Application.WorksheetFunction.Round(((Abs(Discriminant)) ^ (1 / 2)) / (2 * a), 3) & "i"
    ANS(1) = Application.WorksheetFunction.Round((-b / (2 * a)), 3) & "-" & Application.WorksheetFunction.Round(((Abs(Discriminant)) ^ (1 / 2)) / (2 * a), 3) & "i"
    QUADRATIC = ANS
    End If
    End Function
    Thanks for your attention and help, have an amazing day.
    Last edited by briannipa; 10-17-2020 at 04:26 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Usage of standard functions into custom function (or user defined function)
    By tusharb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2016, 12:43 AM
  2. COUNTIF/COUNTIFS function + nested user-defined function
    By shamjamali in forum Excel General
    Replies: 1
    Last Post: 05-12-2015, 09:12 PM
  3. User-defined function to compare value to a table and display corresponding value
    By catwithafiddle in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-23-2013, 08:01 PM
  4. [SOLVED] User defined function returns an error on a standard function used in it.
    By pb48 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2013, 01:35 PM
  5. Display Expense used up in user defined date range
    By Terrycos in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-22-2008, 10:12 AM
  6. Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 PM
  7. Need to open the Function Arguments window from VBA for a user defined function.
    By korrin.anderson@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-20-2006, 10:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1