+ Reply to Thread
Results 1 to 2 of 2

debugging macro switches to UDF which then gives #VALUE!

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Maryland
    MS-Off Ver
    2007
    Posts
    6

    debugging macro switches to UDF which then gives #VALUE!

    I have a UDF on a main sheet with about 5k rows that takes the name from another cell on the same row - removes some characters (middle initial, etc) and displays everyone's name in a particular format <lastname>, <First Name>.

    I have some VB that runs on the same sheet and looks to that cell where the UDF is. Specifically it is this.

    Please Login or Register  to view this content.
    That pops an immediate Error 13 - type mismatch (avarsplit is declared as Variant)

    When I'm stepping through the VBA line by line it has no problems until it gets to that particular line on avarsplit - then it tosses the Type Mismatch error and all of the fields in the column that holds the UDF changes to #VALUE! Sometimes the debug window switches to the UDF module.

    Either way there's no way to get back the values unless i totally exit out of excel and reopen - and then it'll just toss the #VALUE! again. Has anyone run into this before?

    For reference my UDF is this
    Please Login or Register  to view this content.
    I recently added the on error resume next and the application.volatile.
    Last edited by mdnuts; 02-23-2015 at 01:08 PM. Reason: adding details.

  2. #2
    Registered User
    Join Date
    06-25-2014
    Location
    Maryland
    MS-Off Ver
    2007
    Posts
    6

    Re: debugging macro switches to UDF which then gives #VALUE!

    hmmm, so I tossed it into a variable first then went against the variable. it seems to work.

    i still run into the problem of the debug switching from the VBA module to the UDF when stepping through it - if anyone has experienced that.

+ 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. Macro switches the date format from UK to US
    By gallen6945 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2014, 09:49 AM
  2. Using a Macro that switches between workbooks
    By Jorge in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-22-2006, 07:10 AM
  3. Don't show sheet switches when running macro
    By Ben in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-25-2005, 09:22 AM
  4. [SOLVED] Macro for Filter Switches ... Maybe???
    By Ken in forum Excel General
    Replies: 4
    Last Post: 02-25-2005, 02:06 PM
  5. Filter Switches vs Macro?
    By Ken in forum Excel General
    Replies: 3
    Last Post: 02-24-2005, 07:06 PM

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