+ Reply to Thread
Results 1 to 13 of 13

Drop down menu proplem not giving me pop up message

  1. #1
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Drop down menu proplem not giving me pop up message

    Drop Down and Popup Message
    Hi There

    I've already found useful VBA codes to get a popup message even for drop down menus. The spread sheet I'm working on it does not work with these helpful formulas. If for example you select "no" on drop down and the cell number might be number 2, there is no pop up. However if you select target cell somewhere else on formula not to do with drop down the pop up will appear. So its as though the drop down connect to the cell target ignore any numbers that are change on the drop down menu. However if I manually type over the cell link on the drop down cell it will work to get the pop up. I want it to work using the drop down menu. Hope this makes sense and is it something simple I've missed?

    here is an example of a formula which I'm sure is fine but it ignores every time if I'm go by the cell link in the drop down properties. If I don't sue a drop down then it works in a different cell

    Private Sub Worksheet_Change(ByVal Target As Range)
    If Range("A1") > 0.5 Then
    MsgBox "Discount too high"
    End If

    END SUB

    HERE'S another again does not work with drop down



    Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("A1:A100")) Is Nothing Then Exit Sub
    If Target.Value = "X" Then MsgBox "Aaargh!", vbExclamation
    End Sub

    I've also tried data validation and same thing happens and does not work with a drop down on my spread sheet in the cell link.

    Thanks


    Robert

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Drop down menu proplem not giving me pop up message

    You are using a control with a linked cell. Changing that control (and the value of the linked cell) doesn't actually fire the worksheet's change event, which requires direct entry into a cell.

    So either:

    1) in another cell, use a linking formula to that cell, and use the worksheet calculate event to check the value of the cell with the formula.
    2) get rid of the control, and use Data Validation with the "List" and dropdown options on that cell. Then the cell will change, and the change event will fire.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    first option works like a treat. Thank you

  4. #4
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    Sorry I am now getting the same message boxes that will popup by default 15 times when i'm running another macro code to clear contents. How can I stop this.

  5. #5
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Drop down menu proplem not giving me pop up message

    As the first line in the other code, use

    Please Login or Register  to view this content.
    and as the last line, as well as in any error handler:

    Please Login or Register  to view this content.
    Another option is to store the value for comparison somewhere and only execute the code if the value changes, like

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 10-02-2015 at 08:46 AM.

  6. #6
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    Bernie thanks for the help but is it possible or anyone you can use my first example and embed this correctly as won't work for me.

  7. #7
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Drop down menu proplem not giving me pop up message

    Give this book a try....


    Book1.xlsm

  8. #8
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    Thanks for the advise but I'm trying to do something like the following. Problem is if both criteria = 2, on the first one it pops up find but on the second one I get two pop up messages one after the other. How can I stop this if someone can please amend my formula.

    Private Sub Worksheet_Calculate()
    If IsNumeric(Range("c63")) Then
    If Range("c63").Value = 2 Then
    MsgBox "You should only select this option if the eligible rent is exempt in certain accommodations such as supporting housing or if the 13 week protection rule applies. ", vbInformation
    End If
    End If

    If IsNumeric(Range("b52")) Then
    If Range("b52").Value = 2 Then
    MsgBox " supporting housing or if the 13 week protection rule applies. ", vbInformation

    End If
    End If
    End Sub

  9. #9
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Drop down menu proplem not giving me pop up message

    You need to do some other work, including storage cells.

    Book1.xlsm

  10. #10
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Wink Re: Drop down menu proplem not giving me pop up message

    Thank you very much - you are a star and I have learned something again.

  11. #11
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    can someone please tell me how to add a third line to the following code if I want Storedvalue3 say cell A1?

    If Range("Storedvalue").Value = Range("C63").Value And _
    Range("Storedvalue2").Value = Range("B52").Value Then Exit Sub

    Thank you

  12. #12
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    6,274

    Re: Drop down menu proplem not giving me pop up message

    I hope you can see the pattern for adding more....

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    11-10-2014
    Location
    bath
    MS-Off Ver
    2007
    Posts
    21

    Re: Drop down menu proplem not giving me pop up message

    works perfect - thank you once again.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Resetting a drop down menu by selecting another drop down menu
    By Chris07 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2013, 11:57 AM
  2. Replies: 1
    Last Post: 02-07-2013, 11:03 AM
  3. [SOLVED] I cant work out how to create a drop down menu that relates to another drop down menu
    By louise2613 in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 08-18-2012, 01:49 PM
  4. Replies: 0
    Last Post: 06-25-2012, 03:22 PM
  5. IF function giving error message
    By Neilbr in forum Excel General
    Replies: 5
    Last Post: 05-12-2009, 07:54 AM
  6. Replies: 2
    Last Post: 01-30-2009, 04:23 PM
  7. Replies: 9
    Last Post: 08-04-2006, 04:35 AM

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