+ Reply to Thread
Results 1 to 4 of 4

Help in finding if a variable match a list of strings

  1. #1
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    104

    Help in finding if a variable match a list of strings

    Hello,

    Looking for some help on checking if a variable match a list in an array. As an example, the variable will be updated during the macro 5 times and will be one of the following:
    Region1, Region2, Region3, Region4, Region5

    What I am looking for is if it is region1 to 3, then goto step1. If not, go to step2.

    Below are some examples of codes I tried but did not work, I believe I am close to the solution but could not find a solution online after searching a bit.

    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Thanks you for your time!

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

    Re: Help in finding if a variable match a list of strings

    You have to loop through the array:
    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
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,408

    Re: Help in finding if a variable match a list of strings

    Does this work for you...
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-29-2012
    Location
    Ottawa, Ontario
    MS-Off Ver
    Excel 2013
    Posts
    104

    Re: Help in finding if a variable match a list of strings

    Thank you that worked, will mark as solved.

+ 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. [SOLVED] Compare a list of strings against a list of keywords to return a partial match
    By randomkiwi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2017, 11:51 PM
  2. [SOLVED] Match Function in VBA finding strings
    By beric7 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2016, 10:47 AM
  3. Replies: 5
    Last Post: 06-18-2015, 09:10 AM
  4. [SOLVED] Finding row number using Match then assigning to variable
    By D_N_L in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-26-2014, 08:55 AM
  5. Replies: 9
    Last Post: 12-21-2012, 04:18 AM
  6. Replies: 6
    Last Post: 03-08-2012, 10:35 AM
  7. Finding Start Position of string in list of strings
    By longfisher in forum Excel General
    Replies: 5
    Last Post: 05-25-2007, 10:34 PM

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