Excel formula

Posted on 2011-10-24
Last Modified: 2012-06-27
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.
Question by:kurajesh
    LVL 33

    Assisted Solution

    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.

    LVL 12

    Accepted Solution

    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

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
    Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now