Learning resources Microsoft Virtual Academy Channel 9 MSDN Magazine Community Forums Blogs Codeplex Support Self support Programs BizSpark (for startups) Microsoft Imagine (for students) United States (English) Newsletter Privacy & cookies Similarly, a With...End With block must be initialized by executing the With statement entry point. So, today, I automated a bit more by searching column J for the = sign, presenting user with a message box that shows them the contents of the cell with the Register To Reply 11-25-2012,12:54 PM #4 AlphaFrog View Profile View Forum Posts Forum Guru Join Date 07-25-2011 Location Florida MS-Off Ver Excel 2003 Posts 5,410 Re: FIND function returns Runtime Error have a peek at this web-site
What does the following character mean in German: »Ø«? Sorry for this, but I don't want to play around with your code anymore, since it is working now... SSjmg2477, Feb 14, 2006, in forum: Microsoft Excel Programming Replies: 2 Views: 263 SSjmg2477 Feb 14, 2006 Getting "Object Variable or With Block Variable not set" error Suraj, Feb 23, 2006, Has there ever been a sideways H-tail on an airplane? http://stackoverflow.com/questions/9199951/vba-in-find-function-runtime-error-91
Rule One of which requires you to use Code Tags when posting code to the Forum. Yes No Additional feedback? 1500 characters remaining Submit Skip this Thank you! I have noted the section causing the error. Should read: The find method returns a range object which needs to be set to a range variable which can be tested; or else you need to use an error handler
You can only upload photos smaller than 5 MB. Sorry for this, but I don't want to play around with your code anymore, since it is working now... Browse other questions tagged excel vba excel-vba or ask your own question. You specified a line inside a With block when you chose the Set Next Statement command.
I can't see why the first 100 rows are OK and then it breaks. Any guidance would be very helpful. Powered by vBulletin Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. Instead, assign the return value to a Range object and test for success: Dim r As Range Set r = Cells.Find(What:=SearchValue, SearchOrder:=xlByRows, SearchDirection:=xlNext, SearchFormat:=False) If Not r Is Nothing Then '
But, how do I get the row, when I add a .Row at the end I get the same error. What should be my next steps then? You can only upload a photo or a video. All rights reserved.
But you can let SET out if you just waht the Row. What does the following character mean in German: »Ø«? Excel Vba If Find Not Found Yes, my password is: Forgot your password? Vba Error Handling Any suggestions?
VB: deleteRow = ActiveSheet.Cells.Find(What:=Find, After:=ActiveCell, LookIn:=xlValues, _ LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, _ MatchCase:=False, SearchFormat:=False).Row FYI, the whole sub looks like this: VB: Sub DeleteSecretaries() MaxCounter = SecretariesLastRow ' Initialize variables. Check This Out Very annoying... See my post in this link. Results 1 to 4 of 4 Thread: Handling "Find" when nothing is found (error 91) Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Object Variable Or With Block Variable Not Set
You can only upload a photo (png, jpg, jpeg) or a video (3gp, 3gpp, mp4, mov, avi, mpg, mpeg, rm). Trick or Treat polyglot Why does multiple inheritance increase sizeof of the object despite no virtual functions? Register To Reply 11-25-2012,04:08 PM #12 Ivkosky View Profile View Forum Posts Registered User Join Date 04-16-2010 Location London MS-Off Ver Excel 2010 Posts 23 Re: FIND function returns Runtime Error Source asked 4 years ago viewed 15142 times active 4 years ago Blog Stack Overflow Podcast #93 - A Very Spolsky Halloween Special Visit Chat Linked 1 Excel VBA :: Find function
Using Elemental Attunement to destroy a castle Why does the Developer Console show different extensions like "apxc" and "apxt"? However, I don't know where it refers to, because the only object in the FIND function is the Cell., which I don't have to define. The problem is that...
excel vba excel-vba share|improve this question edited Aug 20 '15 at 14:14 shA.t 8,47441543 asked Aug 19 '15 at 11:37 Tim Wilkinson 96921135 add a comment| 3 Answers 3 active oldest Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote « Previous Thread | Next Thread » Like this thread? The With block must be initialized by executing the With statement. For additional information, select the item in question and press F1. Ozgrid is Not Associated With Microsoft.
You may have to register before you can post: click the register link above to proceed. The problem is that this macro is in a do/loop where it's loading multiple sheets that either may or may not have that data (and the cell is not static either). Advanced Search Forum HELP FORUMS Excel General Runtime Error 91 when using Find Excel Training / Excel Dashboards Reports If this is your first visit, be sure to check out the have a peek here You'll be able to ask any tech support questions, or chat with the community and help others.
So you need to make sure that everything you are feeding VBA to look for is actually there, or catch the error and resolve what to do if it isn't. Register To Reply 11-25-2012,01:49 PM #10 Ivkosky View Profile View Forum Posts Registered User Join Date 04-16-2010 Location London MS-Off Ver Excel 2010 Posts 23 Re: FIND function returns Runtime Error asked 4 years ago viewed 4579 times active 8 months ago Blog Stack Overflow Podcast #93 - A Very Spolsky Halloween Special Linked 1 item not found in “Find” vba 0 For example, if the Set statement is omitted in the following code, an error would be generated on the reference to MyObject:Dim MyObject As Object ' Create object variable.
I dont answer coding questions via PM or EMail. I know the value is in the column A, why is the error existing? –Brian Feb 8 '12 at 20:18 On Error Resume Next is there because if .Find For context, I'm trying to obtain the column number for a preset date (using ActiveCell.Column).