• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 155
  • Last Modified:

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

kgerbChief 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


Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now