+ Reply to Thread
Results 1 to 7 of 7

Need macro to check if text in one range exists in another, if yes, insert message box...

  1. #1
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Need macro to check if text in one range exists in another, if yes, insert message box...

    Range A2:A50 has names

    Range F2:W20 also has names

    Check if a name from A2:A50 exists in F2-W20

    If Yes, trigger Message Box "Please Unschedule 'the repeated name'" (ok button to accept)

    If No, then do nothing

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,810

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    try:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    I'm sorry, I explained the problem incorrectly.

    C13:C60, E13:E60, G13:G60, I13:I60 and K13:K60 have names (it's a roster of employees).

    N23:N150 is a collection of these names.

    If a name gets deleted from C13:C60, E13:E60, G13:G60, I13:I60 and K13:K60 it needs to be removed from N23:N150

    I currently have a sorting macro that handles that Column. I want to add a command to that macro that does the following:

    If a name no longer exists in C13:C60, E13:E60, G13:G60, I13:I60 and K13:K60 but does exist in N23:N150 a message box should be triggered to say "Please Unschedule 'name'"
    Blank Spaces should be ignored.

    Thanks for your help
    Rich

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    Quote Originally Posted by rcicconetti View Post
    If a name no longer exists in C13:C60, E13:E60, G13:G60, I13:I60 and K13:K60 but does exist in N23:N150 a message box should be triggered to say "Please Unschedule 'name'"
    Blank Spaces should be ignored.
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    Jindon,

    I had to exchange N23:N150 for the range X7:BS55 it gives me a debug error on the "x = Filter...line".
    Any suggestions?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    Something like
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-11-2016
    Location
    USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Need macro to check if text in one range exists in another, if yes, insert message box

    Thanks! Works great!

+ 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. Check Range for negative value, and add to value if it already exists
    By ericbartha in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-06-2015, 02:34 PM
  2. Check if a User's Email already exists in a range
    By ericbartha in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-07-2015, 01:22 PM
  3. Check if a named range exists
    By Hein in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2010, 09:16 AM
  4. a macro code to check exists of name or text in sql database
    By abhay_547 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2009, 12:16 AM
  5. How to check if range exists
    By z0rpia in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-14-2009, 12:15 AM
  6. [SOLVED] Check if named range exists!
    By steve_doc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-29-2006, 07:00 PM
  7. Check if a number exists in a range?
    By gkaste in forum Excel General
    Replies: 2
    Last Post: 07-13-2005, 03:00 PM

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