+ Reply to Thread
Results 1 to 5 of 5

Checking if cell contains part of a string in another cell.

  1. #1
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Checking if cell contains part of a string in another cell.

    Thinking of it like this, I have 2 columns of data, and the Right column has a string of text, e.g Qsdf, and the left column has the string in it, usually without the Q, eg sdf
    This data goes for around 500 rows, so I am wondering if a macro would be possible that checked to see that the left hand column is contained within the right hand column, for each row, and maybe producing a MsgBox if not?

    Ive tried coding it but I cannot seem to rationalise it in my head, I know you would define a string, then select the RHS column but how does one compare it the the LHS, Using loops?

    Alex

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Checking if cell contains part of a string in another cell.

    using vba I would probably do this with the instr, something like:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Checking if cell contains part of a string in another cell.

    Really appreciate it, it all makes sense now!

  4. #4
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Checking if cell contains part of a string in another cell.

    If I wanted to get a sort of checklist, to maybe run in a column next to it. I have attempted the code below but it only seems to put it into cell 1 and none of the others.

    Please Login or Register  to view this content.

    I am new to VBA so forgive me if what i am doing is making silly mistakes!

    Alex

  5. #5
    Registered User
    Join Date
    08-17-2014
    Location
    london
    MS-Off Ver
    2010
    Posts
    17

    Re: Checking if cell contains part of a string in another cell.

    Hi,

    I played around and managed to come up with a solution. Just for anyone who may need to look at, from a begginers perspective:

    Please Login or Register  to view this content.
    Thanks again!
    Last edited by AMWalton89; 08-20-2014 at 11:04 AM. Reason: Spelling

+ 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] Bold part of cell string
    By willara23 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-02-2013, 02:19 AM
  2. [SOLVED] Replacing part of a string with a value of cell for each row
    By diamanthian in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2013, 04:26 PM
  3. Replies: 3
    Last Post: 07-08-2006, 02:45 PM
  4. Move Part of Cell String
    By tom in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-13-2005, 02:05 PM
  5. select part of a cell value string
    By rich_j_h in forum Excel General
    Replies: 2
    Last Post: 05-19-2005, 07:06 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