VBA code for expiry date

A

Alam

Dear All
Please any one can help me.
If My Data Like
NAME PASSPORT NO. ISSUED DATE PASSPORTEXPIRY
DATE
LOUIS HENNERY B125556 5/5/2004 5/5/2007
VICTOR H. S A125586 1/9/2005 1/9/2008

I want when I open this data file, MsgBox showing the list name of staff
their passport is near or already expired.
Thanks
 
G

Gary''s Student

Easier to use conditional formatting
If the Exp dates are in column D starting in D2, then select D2 and:

Format > Condtional formattting... > Formula Is:
=TODAY()+30>D2
pick a good cell hi-light color

copy this format down the column. If you need more than 30 days advance
notice, just change the 30 in the formula
 
A

Alam

Thank you very much for your help.

Gary''s Student said:
Easier to use conditional formatting
If the Exp dates are in column D starting in D2, then select D2 and:

Format > Condtional formattting... > Formula Is:
=TODAY()+30>D2
pick a good cell hi-light color

copy this format down the column. If you need more than 30 days advance
notice, just change the 30 in the formula
 

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