Yes/No Pop-up window

  • Hi, my problem is probably easy to solve.


    I have a certain macro which copies data from one file to the other. There are several target files (refering to a given month each) and one source file. The user chooses a month from a drop down list in the source file which modifies a certain cell. The value of this cell decides on which of the 12 target files will be opened to paste the data to. The macro also copies the value of a cell which refers to the current date (=TODAY()) This number is then compared with a the range (value between two pints in time: start and end date of a given month). All I need is some sort of a pop-up window with a header i.e. WARNING. and the window text: You are about to send the information to a file which does not refere to the current month, are you sure you want to perform this action" and two buttons YES and NO in case the value of the current date does not match the range set up by the starting and ending of a given month in the target file. The button YES would then do waht ever the code that was placed before the pop-up window said, save the aplication and close it, and the NO button would simply close the aplicatiown without saving it. Something like that:




    Thanks for taking your time and for helping me out here.
    Regads


    Luke

  • Re: Yes/No Pop-up window


    Well, you can use a message box for a yes no answer... something like this.



    HTH
    Ger

    _______________________________________________
    There are 10 types of people in the world. Those that understand Binary and those that dont. :P


    Why are Halloween and Christmas the same? Because Oct 31 = Dec 25... ;)

    _______________________________________________

  • Re: Yes/No Pop-up window


    Hey buddy have a play with this code, You need to add code and play around a bit, let me know if you get stuck, I will try a better example for You

    Quote


    two buttons YES and NO in case the

    [vba]
    ' written by Jack in the UK for http://www.OzGRid.com
    ' Our WEB site http://www.Excel-It.com

    vYesNo = MsgBox("Some Message Here", vbYesNo, "www.Excel-It.com")
    [/vba]

  • Re: Yes/No Pop-up window


    Thank you all. I finally came up with a combination of 2 mesage boxes.


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!