+ Reply to Thread
Results 1 to 12 of 12

Alert - When 3 conditions are met on the same row

  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Alert - When 3 conditions are met on the same row

    Hello All,

    I'm looking for vba for the following situation.

    Excel 2007

    On tab (Sheet4) labeled "Orders"

    Event trigger = After data has been entered into the first empty cell(s) of Column H

    Check to see if the following three conditions are true (I shall setup a button to activate the VBA code)

    1st - Column C - a cell has the phrase -> 2) Replacement Only
    2nd - Column B - same row, the cell has a date that is -> older than 10 days
    3rd - Column H - same row, the cell is -> blank (should have a date in it - If it has a date - no action regardless of the age of the date in column B)

    'When all three conditions are met then a Message box: A Replacement Only Order has not delivered yet.
    And have the cell in column C have this attribute... ActiveCell.Interior.ColorIndex = 6

    If there re not any instances then no message or alert.

    It would be cool if the message box could report how many instances occurred. If not, it wouldn't be

    necessary for multiple Message box pop ups for each instance. (Just one alert)


    Thanks so much in advance.
    Last edited by Alvin Hunter; 04-16-2012 at 11:45 AM.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    i was a bit confused if you wanted this to loop through multiple lines, but this will run on the line you enter a change, i can modify to loop if that is what you are looking for.

    Please Login or Register  to view this content.
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Alert - When 3 conditions are met on the same row

    Hi,
    Thank you for your assistance.

    Yes, please. The code needs to loop.

    Thanks again.

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    what would be the range for the loop?

    row 2 through first empty in row in column C?

  5. #5
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Alert - When 3 conditions are met on the same row

    That would work. Thank you again

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    test this out and let me know how it works

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Alert - When 3 conditions are met on the same row

    The code found one instance, however there are two on the spreadsheet. It found the one at the bottom of column H. The other instance is 5 rows up. The message box did not appear either.

  8. #8
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    could you supply a test workbook? and the msgbox was my falut, this shoudl fix that

    Please Login or Register  to view this content.
    Last edited by DGagnon; 04-16-2012 at 04:42 PM. Reason: code edit

  9. #9
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Alert - When 3 conditions are met on the same row

    Test sheet .xlsm

    I created a duplicate of row 1475 and placed it on row 1470

    The spreadsheet get updated daily. So, new data in all columns occur every day.

    Thanks again

  10. #10
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    this should work, as you are using a button to run it, you dont need it in the change event you can just put it in a new sub

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    12-22-2011
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Alert - When 3 conditions are met on the same row

    That works! Thanks again.

  12. #12
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Alert - When 3 conditions are met on the same row

    glad to help, good luck with the rest of the project.

+ 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