+ Reply to Thread
Results 1 to 6 of 6

Compare 2 adjacent cells each with a lot data for selected special match

  1. #1
    Registered User
    Join Date
    06-03-2014
    Posts
    3

    Compare 2 adjacent cells each with a lot data for selected special match

    Hi

    First post so please forgive me if this is too difficult.

    I have a spreadsheet with text in multiple cells in Cols A and B
    I want to search for a specific piece of text in Column A
    When it finds that text I want to search the corresponding cell in column B to verify if its also there or not
    If it is there I want to print a relevant text message to corresponding cell in column C saying 'found' or 'not found'

    E.g.
    Say text in cell
    A1 = /TD_1 is active
    B1 = /TD_1 not available

    I want to search for TD_1 and verify it matches both cells and output the result found into C1

    Is VBA the best way to do this or can anyone help?
    I have been searching Regex functions as well but I don't know how to use this properly in Excel

    Thank you

  2. #2
    Valued Forum Contributor
    Join Date
    09-21-2011
    Location
    Birmingham UK
    MS-Off Ver
    Excel 2003/7/10
    Posts
    2,188

    Re: Compare 2 adjacent cells each with a lot data for selected special match

    Sorry didnt read properly.
    Hope this helps

    Sometimes its best to start at the beginning and learn VBA & Excel.

    Please dont ask me to do your work for you, I learnt from Reading books, Recording, F1 and Google and like having all of this knowledge in my head for the next time i wish to do it, or wish to tweak it.
    Available for remote consultancy work PM me

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Compare 2 adjacent cells each with a lot data for selected special match

    Find the attached sheet to see if this is how you want to do it.
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    06-03-2014
    Posts
    3

    Re: Compare 2 adjacent cells each with a lot data for selected special match

    Thanks sktner - that does work and it also allows for blank lines in the sheet which is great becasue I have those in my data. I have tested it and amended it a little too to show the 'not found' as there are a lot of keywords to search for. One problem though is that sometimes I have a cell that contains 2 keywords to search against. For instance

    A1 = /TD_1 is active and GOOD - (keywords /TD_1 and GOOD)
    B1 = /TD_1 not available and BAD - (keywords /TD_1 and BAD)

    In this instance i want it to return a 'not found' match becasue even though both keywords are there the cells don't match. Im guessing its some sort of nested 'if' or else is it a collection? I.e. Can I put all the keywords into a collection to search against them ?

  5. #5
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: Compare 2 adjacent cells each with a lot data for selected special match

    I have never worked with the Collections so cannot tell you about the possibility. Maybe a VBA expert can tell you that and this forum has many VBA experts. Lets hope that somebody comes forward with a possible solution to your problem.

  6. #6
    Registered User
    Join Date
    06-03-2014
    Posts
    3

    Re: Compare 2 adjacent cells each with a lot data for selected special match

    hopefully someone can
    Thank you a lot for your help as well sktneer.
    As I am new is there a way to reward assistance ? I don't know other than saying thanks.

+ 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. Paste Special only selected cells
    By sureshpunna in forum Excel General
    Replies: 4
    Last Post: 10-22-2013, 06:22 AM
  2. Macro to compare text in ranges to find match and replace with adjacent value.
    By 54ed in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-11-2013, 06:44 PM
  3. [SOLVED] Compare two lists in Sheet 1 & 2 Column A, then combine the match adjacent cells in sheet3
    By Raulus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-06-2013, 08:51 AM
  4. [SOLVED] VBA Code - Compare Adjacent Cells In two columns and clear contents when a match is found
    By Langer101 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 01-03-2013, 06:22 AM
  5. [SOLVED] would like to compare data in 2 cells and IF they match, it should put TRUE in a new colum
    By ematthew72 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-01-2012, 06:09 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