+ Reply to Thread
Results 1 to 4 of 4

Macro for message box based on data selected from drop-down - not hard coded

  1. #1
    Registered User
    Join Date
    01-15-2019
    Location
    Miami
    MS-Off Ver
    2016
    Posts
    66

    Macro for message box based on data selected from drop-down - not hard coded

    I'm trying to create a macro that when a user selects a group from a drop-down that also appears in the table on the other sheet, a message box appears.

    But I can't hard code the items in the macro so I'll try to break this down to make it easier to understand.

    1 - I have a drop-down in sheet 1 with several groups
    2 - I have a table in sheet 2 with parallel and master groups in columns B and C that are associated with the groups from the drop-down (also in column A of sheet 2)

    I'd like a pop-up message to show if the group selected in the drop-down in sheet 1 also appears in the parallel group and/or master group columns B2:B40 and C2:C40. The pop-up would basically alert the user that the group selected has a parallel and/or master group and they need to select those in the rows below.

    I found the macro below that would work if I were able to hard code the data I want the pop-up to show for, but in this case I can't as this is a dynamic table that get updated constantly.

    Please Login or Register  to view this content.
    I'm attaching a sample file to help explain what I need.

    Thanks in advance!
    Attached Files Attached Files

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

    Re: Macro for message box based on data selected from drop-down - not hard coded

    Have a testrun with this code..
    Please Login or Register  to view this content.
    this will find if the selected value is in the mentioned range of B2:C40 if the value is found the messagebox will show

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

    Re: Macro for message box based on data selected from drop-down - not hard coded

    I saw a small mistake in my answer (Range B2:C40 should be Range (A2:A40) to find the group in the list.
    Also your question says they need to add the groups in the rows below.. You can also show the parallel group and mastergroup found in the msgbox and ask if they should be added.

    So I wrote a code to do that..

    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    01-15-2019
    Location
    Miami
    MS-Off Ver
    2016
    Posts
    66

    Re: Macro for message box based on data selected from drop-down - not hard coded

    This is awesome @Roel Jongman! Even better! Thanks so much for the help.

+ 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. Where to store data - hard coded or in an external file
    By KevBotes in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-24-2016, 01:45 PM
  2. Using RangeName instead of hard coded time in OnTime + TimeValue Vba Macro
    By rsaha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-04-2015, 12:01 PM
  3. selecting files to import into a macro, instead of hard coded links
    By Hondahawkrider in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-25-2015, 03:05 PM
  4. Hard-coded Chart Series names show up blank until I paste data?
    By jimojimo in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 06-14-2014, 05:54 AM
  5. [SOLVED] If calculation to copy rows based on hard coded cells
    By batchjb69 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-31-2014, 03:16 PM
  6. [SOLVED] Convert two dimensional row to column data to a hard-coded array
    By evancharles in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-07-2013, 03:15 PM
  7. Drop Down List Hard Coded Values
    By swalsh84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2009, 03:19 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