+ Reply to Thread
Results 1 to 6 of 6

runtime error- For Next loop

  1. #1
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    runtime error- For Next loop

    Please Login or Register  to view this content.







    Hi guys
    Thats the code I have. Basically if any cell in Column AG has a value of "#N/A" I want the code to exit the macro and show the message I wrote "New contract detected........"

    I thought my for-next statement looked fine but it doesnt work

    any idea how I can make an adjustment? Also I need the macro to stop if an "#N/A" value is detected

    thanks
    Last edited by Pasha81; 11-10-2009 at 12:41 PM.

  2. #2
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: runtime error- For Next loop

    I'm asking for it to exit the macro if 'N/A' is detected because this is just the beginnning of the code, there's more after that which will be carried out only if no 'N/A' values are detected in column AG

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: runtime error- For Next loop

    Try this:
    Please Login or Register  to view this content.
    Please edit your post and change the PHP tags to CODE tags.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: runtime error- For Next loop

    Thanks shg, that works...

    I'll mark this as solved

    However when i enter it into my larger code, it enters a row of "#N/A" values instead of leaving it blank, I'll post a new thread with aworkbook

    Thanks again

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: runtime error- For Next loop

    Pasha, not QUOTE tags, not PHP tags, CODE tags.

  6. #6
    Forum Contributor
    Join Date
    05-13-2009
    Location
    London, England
    MS-Off Ver
    Excel XP
    Posts
    174

    Re: runtime error- For Next loop

    sorry, I found it now on the advanced options

    thanks

+ 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