Excel formula

i have an excel sheet and one particular column (f4) refers to date. whenever user enter any date value in that cell user must get a warning message in that cell or anyother column and the condition is f4+5days is the expiry date.
LVL 1
kurajeshSenior Systems AnalystAsked:
Who is Participating?
 
kgerbConnect With a Mentor Chief EngineerCommented:
Put this code in your worksheet module.  It will pop up a warning message whenever a date is entered into column F.  Is this what you want?  See the attached workbook for an example.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Columns("F:F")) Is Nothing Then
    If Target <> "" Then MsgBox "The expiration date is " & Format(Target + 5, "mm/dd/yyyy"), vbInformation + vbOKOnly, "Expiration Warning"
End If
End Sub

Open in new window

Kyle
Q-27411818-RevA.xlsm
0
 
jppintoConnect With a Mentor Commented:
If you want to display on cell G4 the date entered on cell F4, on cell G4 just put =F4+5 and format this cell as Date. If you want to do a different thing, please explain better what you want because it's not so clear...

Please take a look at the attached file.

jppinto
Book1.xlsx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.