+ Reply to Thread
Results 1 to 3 of 3

I want an user defined function that also returns #NUM! as result

  1. #1
    Registered User
    Join Date
    09-22-2016
    Location
    Eisenach, Germany
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    3

    I want an user defined function that also returns #NUM! as result

    Hello,
    I have the following macro (user defined function, for use in Excel cells):
    Please Login or Register  to view this content.
    The problem is marked above. I want to return the error #NUM! as Excel would do, but it seems to be impossible.
    First Error: invalid formats (sure: "#NUM!" is string, the function shall give a date)
    If I change the function definition
    Please Login or Register  to view this content.
    then I get the string (!) value #NUM! in the cell, but not the error value as Excel does (or would do).

    Is it really impossible to return a built-in error from Excel with VBA?
    Last edited by thmshnf; 09-22-2016 at 09:07 AM. Reason: solved by another user

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: I want an user defined function that also returns #NUM! as result

    Hi,

    You may use
    Please Login or Register  to view this content.
    in order to return a true #NUM! error value.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    09-22-2016
    Location
    Eisenach, Germany
    MS-Off Ver
    MS Office Professional Plus 2013
    Posts
    3

    Re: I want an user defined function that also returns #NUM! as result

    Thank you. That solved the problem.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. User Defined Formula result in two different font colours
    By siva1612 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2014, 12:46 AM
  2. User defined function returning "VALUE result
    By tfurnivall in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2013, 05:21 PM
  3. [SOLVED] Use TEXT Address result in user defined formula as Range
    By sinoop_joy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-25-2013, 12:09 AM
  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. [SOLVED] User Defined Function does not the give the correct result
    By rvc81 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2012, 03:07 AM
  6. [SOLVED] Color a result cell in a user defined function
    By aaa in forum Excel General
    Replies: 1
    Last Post: 05-08-2006, 11:25 AM
  7. No correct result of user defined function
    By jostoorged in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-15-2005, 03:21 PM

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