create messagebox when a date is overdue

G

Guest

When I open a workbook in Excel, I want to have a messagebox pop up if there
are due dates not completed. For example: Cell A1 has a Due Date. Cell B1 has
a Date Completed. If on the due date, or a specified number of days prior to
the due date, the Date Completed is not populated, I want a messagebox saying
"Task is due on [date] and is not completed."

Any help would be appreciated.

Cebubum
 
B

Bob Phillips

With Activesheet
iLastRow = .Cells(.Rows.Count,"A").End(XlUp).Row
For i = 1 To iLastRow
If .Cells(i,"A").Value >= Date - 5 Then
If .Cells(i,"B").Value = "" Then
MsgBox "Item overdue on " & Format(.Cells(i,"A").Value,
"dd mmm yyyy")
End If
End If
Next i
End With

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top