+ Reply to Thread
Results 1 to 12 of 12

Pop Up Window when text entered into cell

  1. #1
    Registered User
    Join Date
    03-16-2006
    Posts
    81

    Pop Up Window when text entered into cell

    I'm new to VB and what i want to do is to have a cell with a drop down box and 2 options, Yes and No, which i will do via the data - validation option.
    When No is selected nothing happens but when Yes is selected i want a pop up window to appear with a message and an ok button.
    Every row will have this option in the same column.
    Is this possible?

  2. #2
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    What you need to do is create a validation rule on the cells you want then

    open up VBE go to the worksheet that your vallidation is on in the code window select windows and the change type in what you want done.

    I have attached an example for you.

    Hope this helps you
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-16-2006
    Posts
    81
    Thanks for that, but i have had a look at the worksheet and it doesn't seem to give me any pop up boxes when yes is selected. Am i missing something?

  4. #4
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    so you are able to select yes or no right if so then you have not enabled the macros.

    check your macro security

    tools>macro>macro security then make sure its on medium that way when you open a workbook it will ask if you want to enable or disable.
    close excel

    open the workbook again and try again but this time when it first opens it will ask you if you want to enable or disable macros choose enable macros.

  5. #5
    Registered User
    Join Date
    03-16-2006
    Posts
    81
    I'm using excel 97, don't know if that has anything to do with it. It ask's o enable macros when i open, put there are no macros attached that i can see.

  6. #6
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    no it should work with excel97.

    I take it you are clicking on tools>macros>macros.. you will not see it listed there however if you right click on the tab at the bottom of the screen named sheet1 and then click view code you should see the code that runs when you select a value in column E it will not run if you change any other column other than E.

  7. #7
    Registered User
    Join Date
    03-16-2006
    Posts
    81
    Have had a look at the code, it works if i type in Yes but if i select Yes from the dropdown it doesn't work. Any ideas?

  8. #8
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    In Excel 97, the change event is not triggered by a data validation box ...

    Solution is to add a column (and if need be, hide it..) where formula is
    = changedcell

    HTH
    Cheers
    Carim

  9. #9
    Registered User
    Join Date
    03-16-2006
    Posts
    81
    When you say enter "= ChangedCell", do you mean enter "=F5" for example? Tried that both ways and it didnt work.

    If I can't get it to work then never mind, it has been a good learning experience anyway. If you have any other ideas then please let me know, if not, you help is appreciated anyway.

    Thanks

  10. #10
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Sorry ...

    I mean a link to cell being changed by the validation box ...

    If it does not work, you should re-enable your events ...

    i.e. write a one line macro

    Please Login or Register  to view this content.
    HTH
    Carim

  11. #11
    Forum Contributor funkymonkUK's Avatar
    Join Date
    01-07-2005
    Location
    London, England
    Posts
    500
    Quote Originally Posted by kingdt
    Have had a look at the code, it works if i type in Yes but if i select Yes from the dropdown it doesn't work. Any ideas?

    thats weird it works for me could be because I am using Excel2000 but I find that if I type it and then press enter to go to the next cell then I get it as well as when I select it from the list..

  12. #12
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi FunkyMonk,

    He is facing a known bug in Excel 97 ... which was fixed in Excel 2000

    Cheers
    Carim

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1