+ Reply to Thread
Results 1 to 5 of 5

VBA iserror/vlookup

  1. #1
    Registered User
    Join Date
    04-18-2017
    Location
    NW,UK
    MS-Off Ver
    MS Office 2013
    Posts
    89

    VBA iserror/vlookup

    Hello forum

    I have the below code which works but when i get part of a result it wont show a error but will show a 0, how can it be done so that if a error or that it shows a 0 that it will only show a blank cell

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    thanks in advance

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA iserror/vlookup

    It's one of the downfalls of both VLOOKUP and INDEX/MATCH so you have to test three times:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: VBA iserror/vlookup

    or format as a custom format 0;-0;;@

    and try
    iferror(MATCH(J30,'(Bulk) Helper Sheet'!$A:$A,0),"")

    it does assume that 0 is not a legitimate value in the lookup table
    Last edited by davsth; 01-29-2020 at 08:44 AM.

  4. #4
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA iserror/vlookup

    I thought about that but discarded it because I didn't know for certain that there are *definitely* no legitimate zero values in the table. OP didn't bother to upload a sample workbook

    WBD

  5. #5
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: VBA iserror/vlookup

    Actually, if the return value is a text field (not numeric) then you could simplify:

    Please Login or Register  to view this content.
    WBD

+ 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. if iserror with Vlookup
    By slaneues in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2012, 02:44 PM
  2. IF, ISERROR, VLOOKUP all within IF
    By excel1987 in forum Excel General
    Replies: 4
    Last Post: 07-30-2010, 08:18 AM
  3. VLOOKUP with ISERROR
    By Cfitzwater in forum Excel General
    Replies: 1
    Last Post: 09-04-2009, 05:28 PM
  4. vlookup vs if(iserror)
    By mingali in forum Excel General
    Replies: 6
    Last Post: 09-01-2009, 11:22 AM
  5. Iserror(if(vlookup
    By James_C in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-24-2009, 10:59 AM
  6. [SOLVED] ISERROR VLOOKUP
    By Carole O in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 01:05 AM
  7. [SOLVED] ISERROR VLOOKUP
    By Carole O in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-06-2005, 12:05 AM
  8. ISERROR VLOOKUP
    By Carole O in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-05-2005, 11:05 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