+ Reply to Thread
Results 1 to 6 of 6

Vlook up VBA Error when value not found "runtime error -1004"

  1. #1
    Registered User
    Join Date
    11-28-2011
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    22

    Question Vlook up VBA Error when value not found "runtime error -1004"

    hi all,

    i have two sheets which has thousand lines and i will update it daily so there will increase in line numbers day by day.. instead vlookup formula i planned to use worksheet function vlookup so that it can save time in calculating the worksheet for more than 10 mins. i tried with below code it was success but when the value is not found then it gives me a error "runtime error-1004" below is the vba code. is there any way we can run this without error pls help [email protected]

    Please Login or Register  to view this content.
    Last edited by sriram170; 02-05-2013 at 09:25 PM. Reason: not complying rules

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Vlook up VBA Error when value not found "runtime error -1004"

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code in [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-28-2011
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Vlook up VBA Error when value not found "runtime error -1004"

    hi thanks for the help i ahve done as advised

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Vlook up VBA Error when value not found "runtime error -1004"

    Remove WorksheetFunction from Application.WorksheetFunction....
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-28-2011
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Vlook up VBA Error when value not found "runtime error -1004"

    thank you very much norie it worked like charm! really this forum and member are excel god for me

  6. #6
    Registered User
    Join Date
    11-28-2011
    Location
    chennai
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Vlook up VBA Error when value not found "runtime error -1004"

    I have a file with 4 columns filled with details as listed below


    GL GL CC CC GL combination CC combination Input GL Input cc Yes/no
    164001 164005 8000 8100
    164006 164011 8101 8104
    164012 164017 8106 8109
    164018 164023 8111 8114
    164024 164029 8116 8119
    164030 164035 8121 8124


    #

    If I fill the INPUT GL column and INPUT CC column it should check with each combinations form gl and CC column, let me say if I give 164002 in gl and 8090 then it will check with each combinations from top to bottom if it finds in any row then it should result in yes.. please find a example given below

    #

    GL GL CC CC GL combination CC combination Input GL Input cc Yes/no
    164001 164005 8000 8100 yes yes 164002 8090 yes
    164006 164011 8101 8104 no no
    164012 164017 8106 8109 no no
    164018 164023 8111 8114 no no
    164024 164029 8116 8119 no no

    #

    If I have to check for nearly 1000 combinations then I have to copy and paste each combinations 1000 times and then have to find whether its available. Is there any macro that can find the combinations from the available data.

    please find the attachment so that you may get some idea
    Attached Files Attached Files
    Last edited by sriram170; 02-06-2013 at 01:20 PM. Reason: formatting

+ 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