+ Reply to Thread
Results 1 to 7 of 7

How to resolve Run Time Error-1004

  1. #1
    Forum Contributor
    Join Date
    07-15-2015
    Location
    Kolkata
    MS-Off Ver
    2010 & 2013
    Posts
    303

    How to resolve Run Time Error-1004

    Hi,

    i am getting run time error -1004. please help me how to resolve the issue? Here is the code

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-16-2012
    Location
    Sydney
    MS-Off Ver
    Excel 2019
    Posts
    209

    Re: How to resolve Run Time Error-1004

    Looks fine and i have tested, seems alright to me. try to restart your excel or your computer. Thanks
    Attached Images Attached Images

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,858

    Re: How to resolve Run Time Error-1004

    If you are unfamilar with VBA's debugging tools, I highly recommend that you become familiar with them. http://www.cpearson.com/Excel/DebuggingVBA.aspx

    Application or object not defined error suggests some failure to get the range object. The error I got was pretty obvious, so, in the interest of learning how to use the debugging tools, I won't give the result to you. Here's what I would do:

    1) Run the code until it errors (It took a surprising long time for as little data as you have).
    2) Your screenshot suggests that you do not have any of the debugging windows (locals, watch, or immediate windows) open. Open the locals window (View menu -> Locals Window).
    3) Look in the locals window for the value stored in row_number. The error should be obvious, but, if it is not, return to the spreadsheet and see if you can find that row number in the spreadsheet.
    4) Debug further to figure out how that value got assigned to row_number.
    5) Change loop so that row_number is always a reasonable value.

    Let us know if you need further assistance.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: How to resolve Run Time Error-1004

    @ lexusap

    Give you a tip >> leave the userform open for a minute or two after hitting search button.

    You'll get the error without a doubt. (a million rows takes some time to loop)
    Last edited by bakerman2; 09-14-2017 at 01:02 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: How to resolve Run Time Error-1004

    @ sanjibghosh

    When the error occurs and you open you're Local Variables window you will see that item_in_review has reached the value 1048576.

    Ask yourself how that is possible since you have a condition to loop until item_in_review is empty.

    My advice to you would be to thouroughly check your last line of code being the looping condition.

    Also this isn't the most clever way to do a lookup since you loop all entries even when a match is found in row 1.

    Take a look at Application.Match or Find.

  6. #6
    Forum Contributor
    Join Date
    07-15-2015
    Location
    Kolkata
    MS-Off Ver
    2010 & 2013
    Posts
    303

    Re: How to resolve Run Time Error-1004

    please help me where i need to change in the code

  7. #7
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,909

    Re: How to resolve Run Time Error-1004

    Since you don't seem to be willing to put in any effort and the thread can go back and forth forever.

    Please Login or Register  to view this content.

+ 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. How to resolve "Run Time Error-1004"
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-13-2017, 09:17 AM
  2. Run-Time Error 1004..... Can't Figure Out How to Resolve
    By Chaunciliscious in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-25-2017, 04:54 PM
  3. [SOLVED] I am getting error as "Run Time error '1004' Microsoft excel cannot paste the data
    By Amittapre in forum Excel Programming / VBA / Macros
    Replies: 43
    Last Post: 03-24-2017, 04:40 PM
  4. How to resolve the Run-time error 1004
    By Sanjibghosh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-14-2016, 05:05 AM
  5. [SOLVED] Help to resolve Run time Error 380
    By LenaK in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-30-2015, 11:55 AM
  6. [SOLVED] How can I resolve this Run-Time error '1004': Method 'Range' of object '_Worksheet' failed
    By dafella in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2013, 01:16 AM
  7. Error "run-time Error '1004': General Odbc Error
    By D4WNO77 in forum Access Tables & Databases
    Replies: 2
    Last Post: 07-16-2012, 09:55 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