Results 1 to 10 of 10

WorksheetFunction.VLookup doesnt work if result is #N/A

Threaded View

  1. #1
    Forum Contributor HerryMarkowitz's Avatar
    Join Date
    09-10-2012
    Location
    Europe
    MS-Off Ver
    Office 2021 - Win10
    Posts
    1,014

    WorksheetFunction.VLookup doesnt work if result is #N/A

    Greetings,
    1- Open enclosed file.
    2- Run Macro1.
    Sub Macro1()
    Sheets("Sheet2").Select
    For i = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row To 2 Step -1
        j = Application.WorksheetFunction.VLookup(Sheets("Sheet2").Range("A" & i), Sheets("Sheet1").Range("A2:B10"), 2, 0)
        If j Like "#N/A" Then GoTo exit1
        Sheets("Sheet2").Range("B" & i).Value = j
    exit1:
    Next i
    End Sub
    3- See that error picture in the following link;
    http://i.cubeupload.com/7bc7dw.jpg

    Any idea will be appreciated...Thanks in advance...
    Attached Files Attached Files
    Sub DontForgetThese()
         If Your thread includes any code Then Please use code tags...
         If Your thread has been solved Then Please mark as solved...
         If Anybody has helped to you Then Please add reputation...
    End Sub

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Run macro when cell is changed(also as a result of listboxchange-change event doesnt work)
    By drrazor in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2014, 04:13 PM
  2. [SOLVED] SUMIF function don't return same result with Evaluate and Application.WorksheetFunction
    By zbor in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-31-2012, 12:48 PM
  3. Replies: 14
    Last Post: 03-21-2012, 02:38 PM
  4. Sorting doesnt work-sumproduct, vlookup,IF
    By koklok123 in forum Excel General
    Replies: 1
    Last Post: 05-06-2010, 10:11 AM
  5. worksheetfunction.vlookup result when search argument not found
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-10-2006, 07:16 AM

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