Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


warring message before code runs

Posted on 2011-10-10
Medium Priority
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 21

Accepted Solution

Hendrik Wiese earned 2000 total points
ID: 36947020
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

ID: 36947096
Works great....Thankyou

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article describes a serious pitfall that can happen when deleting shapes using VBA.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

564 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