+ Reply to Thread
Results 1 to 2 of 2

Exit For Loop on Error?

  1. #1
    Forum Contributor
    Join Date
    10-27-2005
    Posts
    177

    Exit For Loop on Error?

    Hi everyone.

    I have the following code which selects all constants from column 2 to 30, then cuts and pastes into column A:

    Please Login or Register  to view this content.
    However, when the code does selection.special on totally blank columns, an error is generated. Is there a way to modify it so that it exits the loop if that error occurs?

    Any help would be much appreciated.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Add code that checks if the ccolumn is empty and of it is exit the loop.

    Something like this perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. [SOLVED] For Next Loop Does Not Exit
    By goss in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2014, 04:52 PM
  2. [SOLVED] Best way to exit this do while loop when an error is encountered
    By vnzerem in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-13-2013, 05:40 PM
  3. Exit loop
    By ashmott in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-19-2011, 05:41 AM
  4. [SOLVED] exit for next loop
    By David Henderson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2006, 02:45 PM
  5. Runtime error '91' when trying to exit Do...Loop
    By Cloudfall in forum Excel General
    Replies: 2
    Last Post: 10-31-2005, 03:05 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