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.
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.
Looks fine and i have tested, seems alright to me. try to restart your excel or your computer. Thanks
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.
Originally Posted by shg
@ 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.
@ 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.
please help me where i need to change in the code
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks