+ Reply to Thread
Results 1 to 7 of 7

VBA Message Box

  1. #1
    Registered User
    Join Date
    06-12-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    11

    VBA Message Box

    I created the message box code below, once I select the cell and value the message box appears and I select ok. however if I select another cell or button the message box continues to pop up. How do I get this to stop when the selection has been made.

    If Range("L28").Value = ("N") Then

    MsgBox ("Customer must go to dealer to finance due to out of state title!"), vbCritical + vbOKOnly, "Happy Selling!"

    End If

    Exit Sub
    End Sub

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Message Box

    Check which cell has been selected.

    PS Use code tags when posting code.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    06-12-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VBA Message Box

    The value is in a drop down field. So when I select "N" the message box does pop up. But when I select the next drop down field or anything else on the page the box continues to pop up with every selection. But only After I select cell "L28" not before.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Message Box

    Can you post the rest of the code?

  5. #5
    Registered User
    Join Date
    06-12-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VBA Message Box

    Please Login or Register  to view this content.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA Message Box

    This code will run whenever a cell in the worksheet is changed.
    Please Login or Register  to view this content.
    If you only want it to run when L28 is changed you need to check for that just as you've checked which cell has been changed in the earlier code.

  7. #7
    Registered User
    Join Date
    06-12-2013
    Location
    Michigan
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: VBA Message Box

    Thanks Norie! It worked!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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