+ Reply to Thread
Results 1 to 3 of 3

#VALUE from VBA function

  1. #1
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Melbourne, VIC, Australia
    MS-Off Ver
    Office 365
    Posts
    243

    #VALUE from VBA function

    I've written a function that works similiarly to the Excel FIND function. Now, if FIND cannot find the first string inside the second it returns a #VALUE error. How can I make my function do the same?

    I am aware of the xlErrValue constant, which returns the error number corresponding to #VALUE (which is 2015) but when I use my function in a cell and it returns this value I literally get 2015 displaying in the cell and not #VALUE as I want.

    What extra trick is required to make Excel realise that a function is returning an error value, not a numeric value?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436
    Something like this

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Melbourne, VIC, Australia
    MS-Off Ver
    Office 365
    Posts
    243

    Thumbs up

    That'll do it. Thanks mate!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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