+ Reply to Thread
Results 1 to 3 of 3

For Loop and Error Handling

  1. #1
    Registered User
    Join Date
    11-21-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    14

    For Loop and Error Handling

    Hi again,
    I am facing a few issues with a For Loop. I have a few Checkboxes from the Forms Controls and I want to write column D the ones not selected and in column I the ones selected but are not found in some other sheet.
    For that I am using a For Loop from i = 60 to 150 (the first checkbox starts in 60, I don't know why). The problem is that checkboxes are not sequential, i.e I have checkbox 60, 62, 63, 64 and so on but checkbox 61 does not exist and that blank checkbox is repeat further without any logic.
    I am using the ErrorHandler which skips the error that pops-up when checkbox 61 is not found, to move to the next number and for that I do i=i+1. This will write down the right values in the right columns but freezes Excel. It goes in a continuous loop.

    Could help me in skipping some values that are not found in the For Loop?

    Please Login or Register  to view this content.
    Thanks in advance,
    Pedro

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: For Loop and Error Handling

    Couldn't you loop through the Shapes collection?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    11-21-2014
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    14

    Re: For Loop and Error Handling

    Quote Originally Posted by Norie View Post
    Couldn't you loop through the Shapes collection?
    How can I do that?
    I am a very basic user of VBA.

+ 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] Error Handling in a loop
    By Turtleman10 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-29-2013, 10:27 AM
  2. [SOLVED] Using Error handling within a Loop
    By uniquelydeep in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-30-2013, 03:41 PM
  3. Error Handling in a Loop
    By amdk8800 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-28-2013, 03:46 PM
  4. [SOLVED] Error Handling in loop - go to next x
    By Phiabell in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-04-2013, 09:30 AM
  5. Error handling within a Do Loop
    By Boondoggler in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-01-2012, 12:15 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