+ Reply to Thread
Results 1 to 3 of 3

VBA VLookup, Error 400, For Each

  1. #1
    Registered User
    Join Date
    05-28-2014
    Posts
    4

    VBA VLookup, Error 400, For Each

    Hello,
    I'm having a small issue with this piece of code:

    Please Login or Register  to view this content.

    The goal is to get the VLOOKUP to use c.Value, just like I do in the next line, to look up the corresponding error explanation located just below the list of Errors. It keeps giving me the red circle with white X accompanied by "400".

    If I get rid of c.Value and put "Error 1", it works fine. But obviously, it's in a loop and this is because the error can change so I want the corresponding message.

    Attached is the sample workbook:
    VLookupError400.xlsm

    Any Ideas? Thanks!
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA VLookup, Error 400, For Each

    Hello cwix09,

    Your workbook runs fine for me. I am running Windows 7 with Office 2010.

    Whenever I do a lot of VBA coding, Excel will start to act weird after while like throwing errors on code I know is correct or just freezing up. My first course of action is close Excel and reopen it. It that fails to fix the problem then I run my registry cleanup program which also defragements the registry.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    05-28-2014
    Posts
    4

    Re: VBA VLookup, Error 400, For Each

    Woops, I forgot to change my code back to what I wanted it to be which is:

    Please Login or Register  to view this content.
    not:

    Please Login or Register  to view this content.
    Here is the file with the correct code in question.
    VLookupError400.xlsm

+ 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. Iferror vlookup if error vlookup if x=Y,
    By rwmeis in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-21-2013, 08:24 PM
  2. How to error trap a vlookup that returns an error or #N/A
    By kjy1989 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-06-2013, 12:01 PM
  3. [SOLVED] lookup - if(is error(vlookup and error messages meanings
    By grphillips in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-18-2013, 07:03 PM
  4. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  5. Excel 2007 : VLOOKUP error
    By captdday in forum Excel General
    Replies: 1
    Last Post: 02-18-2011, 04:15 AM

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