+ Reply to Thread
Results 1 to 4 of 4

Look Up String In Range; If present, Set next Cell to '1'

  1. #1
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Look Up String In Range; If present, Set next Cell to '1'

    I have a column of code values (can be any # of values from 1 - 300)
    If any of 12 specific values are present, I need to set its corresponding cell to the right = 1.

    I was thinking to define the range in Column B, then search for each value 1 by 1. With each search, if present, set cell to right = 1. Look for next value until done. I don't think I can look for all 12 in a single 'IF' AND correctly apply the desired values?

    Example: If Col B = column of 'codes' and RT1 is one of the 12 values that need to be set to 1, I need the code to search through all possible values in Col B for RT1 and then change the value provided in Column C to '1'.

    Col B
    AAREQ
    SSPEI1
    SSPEI2
    SSPEI3
    RGEAQ
    RGTRQ
    RT1
    RT2
    RT3
    R1T

    [How do I bold my thread title?]

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Look Up String In Range; If present, Set next Cell to '1'

    Hello Snoopy2010,

    If column "B" contains the values to be searched, where are the values you want to search for kept?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Look Up String In Range; If present, Set next Cell to '1'

    I thought that the better way myself. Col B resides in sheet named 'REGISTER'. The list of constants (which is actually 21, not 12) I placed in the 'SYSTABLES' sheet. That said, this is what I've compiled so far:

    Please Login or Register  to view this content.
    I don't know if I necessarily need the 'Products' range. I am thinking, within an 'IF' statement, I can identify the range/sheet. Regardless, once the 'IF' statement is established, it needs to Loop through the entire range.

    I so apologize for not doing things according to proper rules. This is my second thread. I'm hoping to get better. How does one 'bold' the thread title when initiating the request? TIA.

  4. #4
    Registered User
    Join Date
    08-25-2010
    Location
    Boston, MA
    MS-Off Ver
    Excel 2007
    Posts
    23

    Re: Look Up String In Range; If present, Set next Cell to '1'

    This is my most current incarnation -
    Please Login or Register  to view this content.
    The problem with this is it will set the wrong cell to '1'. The setting of 1 will occur in SYSTABLES ws not REGISTER ws.

    I'm thinking I must somehow activate the cell located in REGISTER to then set the adjacent cell value to 1? And then re-activate SYSTABLES & StaticVal range?

    Help??? Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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