How to create professional VBA custom function and add screen tip to guide users

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 16

  • @VBAA2Z
    @VBAA2Z  4 ปีที่แล้ว

    Interested to become VBA Pro? Here is 100% free guided e-course with Real-life projects.
    Sign-up to participate, get assignments and a certificate:-
    Sing up link = > bit.ly/3eX8tzl

  • @atil2475
    @atil2475 4 ปีที่แล้ว +2

    Very useful. I have no idea we could add description or argument info using VBA.

    • @VBAA2Z
      @VBAA2Z  3 ปีที่แล้ว

      you're welcome, thanks for watching.

  • @sunil5149
    @sunil5149 4 ปีที่แล้ว +1

    thanks for the knowledge transfer.

    • @VBAA2Z
      @VBAA2Z  3 ปีที่แล้ว

      you're welcome, thanks for watching.

  • @khuramshahzad3936
    @khuramshahzad3936 4 ปีที่แล้ว +1

    Is it possible to call back a user defined function like these on a custom ribbon control?
    Like other built in excel formulas.

    • @VBAA2Z
      @VBAA2Z  4 ปีที่แล้ว

      yes you can. try like this and let me know if have any questions.
      th-cam.com/video/IYXzMvKO51M/w-d-xo.html

  • @mahanpourhosseini871
    @mahanpourhosseini871 3 ปีที่แล้ว +1

    my function has 4 arguments. how can i add all of 4 argument descriptions. yours only have one. thanks

    • @VBAA2Z
      @VBAA2Z  3 ปีที่แล้ว +2

      simply update arg(0)
      to arg(1) if 2 arguments, arg(2) if 3 arguments
      arg(0) = "first argument desc."
      arg(1) = "2nd argument desc."
      arg(2) = "3rd argument desc."
      and so on

    • @mahanpourhosseini871
      @mahanpourhosseini871 3 ปีที่แล้ว

      @@VBAA2ZThank you so much. i have another question and didnt find any answer. how can i define a optional argument for a function so that if i leave it empty the function does not give #value error. like "FV" or "Type" arguments in PV function which as you can see their fonts are not bold like other arguments and they could be left empty.

    • @VBAA2Z
      @VBAA2Z  3 ปีที่แล้ว

      that needs to be handled within your code using if x = "" or if x is nothing etc...

    • @flightszym290
      @flightszym290 2 ปีที่แล้ว +1

      I use the keyword Optional for this problem. The syntax is e.g.:
      Function my_func(a1 As Range, Optional a2 As Double = 1, Optional a3 As Single = 2)
      a2 and a3 are optional and when not specified become 1 for a2 and 2 for a3.
      If you don't want to specify default values and handle missing arguments situation in another way you can write:
      Function my_func(a1 As Range, Optional a2 As Double, Optional a3 As Single)
      and check if a2 or a3 is missing by the IsMissing(argument) function.

  • @TinyGiraffes
    @TinyGiraffes 2 ปีที่แล้ว

    This was interesting but the Application.MacroOptions doesn't actually change anything about my Function

  • @EganathanPushpakharan-uz9po
    @EganathanPushpakharan-uz9po ปีที่แล้ว

    Is it possible to create UDF Argument Custom options? Eg. VLOOKUP shows TRUE or FALSE for the last argument [range_lookup]