+ Reply to Thread
Results 1 to 6 of 6

Using If .. Then to skip a blank combo box in a For...Next

  1. #1
    Registered User
    Join Date
    01-24-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    31

    Using If .. Then to skip a blank combo box in a For...Next

    The problem is that I need to check combo boxes against each other. I did most of the work, but I don't know what to do about blank boxes. Code is below.

    Please Login or Register  to view this content.
    In the first "If" I need something for it to do in order to skip and go on to Next j...such as a Null. But you can't just write null there.

    Or I can reverse the code and use the first if as Not Blank, but I also don't know how to do that.

    Any help is appreciated.


    Extra info:
    Combo boxes are named "cmbVol1" - "cmbVol15"
    They cannot be equal to each other but will not always be filled in. Most of the time there will be some blank ones.
    The goal is to make sure that anything that does have info in it is not the same as something in another box and if so msgBox with message that says so.
    Last edited by Squirrel; 09-09-2011 at 09:12 AM. Reason: solved

  2. #2
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Using If .. Then to skip a blank combo box in a For...Next

    I didn't look too closely at this, but if you're just trying to skip one, you could try this--although it really should be doing that on it's own with the If/Else statement
    Please Login or Register  to view this content.
    Last edited by gjlindn; 09-09-2011 at 12:55 AM.
    -Greg If this is helpful, pls click Star icon in lower left corner

  3. #3
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Using If .. Then to skip a blank combo box in a For...Next

    Could also try this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    01-24-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Using If .. Then to skip a blank combo box in a For...Next

    I used the second one because it was more concise and it was exactly how it needed to be. Although I don't really understand the code in it. If you had time and put comments in that explained it a little bit that would be great. If not that's ok. Thanks!

  5. #5
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Using If .. Then to skip a blank combo box in a For...Next

    Here it is with some comments. If anything doesn't make sense, feel free to ask. Thanks!
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-24-2011
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    31

    Re: Using If .. Then to skip a blank combo box in a For...Next

    great thanks. makes more sense now

+ 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