warring message before code runs

Posted on 2011-10-10
Last Modified: 2012-05-12
I have another message alert:

when a user presses a button it runs code that deletes rows not between the dates seleted in a cell. When the user presses the button before the code runs I want a message to come up "is end date correct" "yes"/"no" if yes pressed then code carries on, if No pressed code stops.


Question by:RobJanine
    LVL 20

    Accepted Solution

    You can try to incorporate the following code into yours:

    Sub Button1_Click()
        answer = MsgBox("Is end date correct?", vbYesNo)
        If answer = vbYes Then
            MsgBox "Your Code Goes Here"
        End If
    End Sub

    Open in new window


    Author Closing Comment

    Works great....Thankyou

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
    Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
    The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
    This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

    758 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

    11 Experts available now in Live!

    Get 1:1 Help Now