+ Reply to Thread
Results 1 to 4 of 4

MsgBox Appearing Twice

  1. #1
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    MsgBox Appearing Twice

    I have 3 drop down options. I want the MsgBox to show when a particular selection is chose from dropdown 2 only. The VBA I created allows this to happen. However, when an option is chosen from dropdown 3, the same MsgBox appears. I only want the MsgBox to show on one occasion following the particular selection from dropdown 2.

    I have attached a sample spread sheet to show my code and to display what is happening.

    Hope that makes sense and if anyone can offer any assistance it would be greatly appreciated
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,607

    Re: MsgBox Appearing Twice

    The whole logic is not 100% clear for mre, but anyway, before showing msgbox, you can check what was the target (which dropdown changed) and act accordingly, so for instance:
    instead of
    Please Login or Register  to view this content.
    use
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    06-13-2018
    Location
    Glasgow
    MS-Off Ver
    2013
    Posts
    33

    Re: MsgBox Appearing Twice

    Apologies I wasn't clear. I only want the MsgBox to appear once when OPTION Z is displayed.

    Currently, it is showing again when I select any option in the Yes/No drop downs (B5 AND B6).

    The user needs to answer the same questions again. I only want them to be answered once when OPTION Z is selected.

  4. #4
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,482

    Re: MsgBox Appearing Twice

    You need to flip the first to IF test lines. so the first test is the target.address is B2 or B3.

    new order:
    Please Login or Register  to view this content.
    Edit: I noticed for good functioning of the code you also need to move 1 end if statement form 2nd line above the end sub to just above the IF Target.colomn = 2.. tests start
    see changes in code below.. I removed the parts with alle the hiding of rows in the select case .. end select section to show the changes in 1 screen

    Please Login or Register  to view this content.
    Last edited by Roel Jongman; 04-11-2019 at 08:38 AM.

+ 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. Variant not appearing in MsgBox?
    By ciapul12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-11-2019, 07:04 AM
  2. Macro to capture MsgBox prompt to a string variable but ignore the MsgBox
    By BuglerDobbs in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2015, 10:56 AM
  3. [SOLVED] Problem with VBA Editor uses lower case on some lines (ex. msgbox instead of MsgBox)
    By stubbsj in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-14-2013, 06:59 PM
  4. Why msgbox is not appearing and why items aren't being removed?
    By marlonsaveri in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-14-2011, 09:59 PM
  5. Scrolling a page when MsgBox is appearing
    By vivekchha in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-15-2010, 11:42 AM
  6. Msgbox not Appearing Upon Opening Excel File
    By eddykk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-19-2009, 04:56 AM
  7. MsgBox-center the message on a msgbox
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2007, 06:48 AM

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