Yahoo Answers is shutting down on 4 May 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

David Z asked in Computers & InternetSoftware · 6 years ago

Can someone provide me the VBA for a pop up to display upon the opening of an excel file on or after the date 1/1/2018?

1 Answer

Relevance
  • 6 years ago

    You would use a Workbook_Open event handler such as the following. Copy this code, changing the message as you wish:

    Private Sub Workbook_Open()

    If Date >= 43101 Then

    MsgBox "The day has arrived!"

    End If

    End Sub

    Press ALT + F11 (Function Key F11).

    Double click 'This Workbook' in the Microsoft Excel Objects in the upper left quadrant.

    Paste the event handler into the white editing area to the right (right click inside the area and 'Paste').

    Close the VBE (Red button - top right).

    Save the workbook.

Still have questions? Get answers by asking now.