+ Reply to Thread
Results 1 to 9 of 9

Loop based on a couple of conditions

  1. #1
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Loop based on a couple of conditions

    I am trying to have a loop go thru the data and then use a msgbox to display the results

    I have 2000 rows of data, no blanks.

    What i want to find is:

    1.) Look at column P to see if the word "Open" appears

    if so continue...if not, check next record

    2.) If open appears then check 4 columns (corresponding) AA, AP, BA, BF to see if the word "Scheduled" appears

    3.) if scheduled appears...go to next record

    4.) If scheduled doesn't appear, then show msgbox with all the account numbers (column b) of the records that showed "Open" but without "Scheduled"


    Hopefully this is easier than it looks...thanks for any help

    JJ
    Last edited by h_aesa1; 03-30-2010 at 01:06 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop based on a couple of conditions

    I suggest you attach a sample workbook.

  3. #3
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Loop based on a couple of conditions

    I have attached a sample workbook...hopefully this helps


    thanks

    JJ
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop based on a couple of conditions

    Try this. Autofilter would also be a good approach, but I couldn't get it to work.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Loop based on a couple of conditions

    works awesome!!!!! thanks for all the help Stephen, appreciate it...


    JJ

  6. #6
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Re: Loop based on a couple of conditions

    I don't know if i am suppose to open a new thread as this one was solved.

    I just had one question in regards to this post.


    The code below works great.

    My question is... How can I do the same code but only look in 2 columns (E & H) to see if both are empty, if both are empty, then flag.....

    Hopefully that makes sense??

    thanks,

    JJ

  7. #7
    Registered User
    Join Date
    02-09-2009
    Location
    Washington, US
    MS-Off Ver
    Excel 2003
    Posts
    73

    Loop based on a couple of conditions

    I posted a thread awhile back and it was solved with the below and it works great!!!

    HTML Code: 

    HOWEVER....

    I want the code to use the same logic, loop thru all records, put results in msg box but i want the code only to check two columns now and only to see if they are empty.

    If both column (E & H) are blank then keep a running list like above and show with msgbox...


    thanks,

    JJ

  8. #8
    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: Loop based on a couple of conditions

    Threads merged.
    Entia non sunt multiplicanda sine necessitate

  9. #9
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Loop based on a couple of conditions

    If I understand correctly... Have added a comment to the line which has changed.
    Please Login or Register  to view this content.

+ 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