VBA Express Forum  




Go Back   VBA Express Forum > VBA Code & Other Help > Excel Help
     Feedback     
Register FAQ Members Arcade Knowledge Base Training Articles Consulting

Reply
 
Thread Tools Display Modes
Old 04-16-2012, 02:30 PM   #1
Ike

 
Joined: Nov 2011
Posts: 6
Kb Entries: 0
Articles: 0
Solved: Alert - When 3 conditions are met on the same row

Hello All,

I'm looking for a "Private Sub Worksheet" vba for the following situation.
Excel 2007
On tab (Sheet4) labeled "Orders"
Event trigger = After multiple rows of data have been entered in Column H (data is Date FedEx Delivered a package)
Check to see if the following three conditions are true

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...

1. Message box: A Replacement Only Order has not delivered yet
2. Have the cell in column C have this attribute > ActiveCell.Interior.ColorIndex = 6

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

There could be multiple instances so, it would be cool if the message box could report how many instances occurred.
It wouldn't be necessary for multiple Message box pop ups for each instance. (Just one alert)

Thanks so much in advance.

Local Time: 08:59 AM
Local Date: 05-22-2013
Location:

 
Reply With Quote Top
Old 04-17-2012, 07:22 AM   #2
Ike

 
Joined: Nov 2011
Posts: 6
Kb Entries: 0
Articles: 0
I figured it out. Thanks anyway

Local Time: 08:59 AM
Local Date: 05-22-2013
Location:

 
Reply With Quote Top
Old 04-17-2012, 11:58 PM   #3
Aussiebear
 
Aussiebear's Avatar
Moderator

 
Joined: Dec 2005
Posts: 2,761
Kb Entries: 0
Articles: 0
Quote:
 
Originally Posted by: Ike
I figured it out. Thanks anyway

Any chance you can put your solution up for others to learn from?


Remember To Do the Following....

Use the VBA button to correctly submit your code to the forum. Mark your thread as Solved if satisfied by using the Thread Tools options

Local Time: 12:59 AM
Local Date: 05-23-2013
Location:

 
Reply With Quote Top
Old 04-18-2012, 07:34 AM   #4
Ike

 
Joined: Nov 2011
Posts: 6
Kb Entries: 0
Articles: 0
A friend helped...and I ended up using a button to activate the code

VBA:
Sub Replacement_Did_Not_Ship() Dim Flaged As Boolean Dim i As Integer Flaged = False For i = 2 To Range("C1048576").End(xlUp).Row If Range("C" & i).Value = "2) Replacement Only" And _ Range("B" & i).Value < Date - 10 And _ Range("H" & i).Value = 0 Then Range("H" & i).Interior.ColorIndex = 6 Flaged = True End If Next If Flaged = True Then MsgBox ("A Replacement Only Order - Not Delivered - 10 Day or More - Alert.") End Sub
VBA tags courtesy of www.thecodenet.com

Last edited by Aussiebear : 04-19-2012 at 02:45 AM. Reason: Added vba tags to code

Local Time: 08:59 AM
Local Date: 05-22-2013
Location:

 
Reply With Quote Top
Old 04-18-2012, 07:58 AM   #5
p45cal

 
Joined: Oct 2005
Posts: 1,705
Kb Entries: 0
Articles: 0
Quote:
 
Originally Posted by: Ike
A friend helped...and I ended up using a button to activate the code

..or rather you cross-posted at:
http://www.excelforum.com/excel-prog...-same-row.html


p45cal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.

Local Time: 02:59 PM
Local Date: 05-22-2013

 
Reply With Quote Top
Old 04-18-2012, 05:11 PM   #6
Aussiebear
 
Aussiebear's Avatar
Moderator

 
Joined: Dec 2005
Posts: 2,761
Kb Entries: 0
Articles: 0
(Sigh).... its a very small world these days.


Remember To Do the Following....

Use the VBA button to correctly submit your code to the forum. Mark your thread as Solved if satisfied by using the Thread Tools options

Local Time: 12:59 AM
Local Date: 05-23-2013
Location:

 
Reply With Quote Top
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -7. The time now is 07:59 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2004 - 2012 VBA Express