+ Reply to Thread
Results 1 to 6 of 6

Search Row by Column value and Highlight Text - For each Row

  1. #1
    Registered User
    Join Date
    07-08-2014
    Location
    Burlington, VT
    MS-Off Ver
    2007
    Posts
    3

    Search Row by Column value and Highlight Text - For each Row

    EDIT: Ahh. The Title is a little misleading; While thinking through what I needed a more useful result is explained below; sorry about that!

    Hey Folks!

    I'm SUPER new to the world of Excel Macros and VBA - so bear with me. I'm not new to the world of coding; so thus far I've been managing by hodge-podging code together to accomplish what I need it to - but I've hit a dead end.

    I'm going to try and explain this to the best of my ability - let me know if I'm unclear what I'm trying to accomplish. I've got a large Excel table that's full of names and e-mail addresses - it's a report of e-mails that merges some data from two systems we use; a registration form and a database. We want to clean up the data so it only lists folks who 'registered' (it's not always BOTH people listed - sometimes it's only one!) - and the best way to do that is to take the information from a specific column in each row, see if it exists elsewhere in the row and clear the information that doesn't match.

    For example:
    -A----------------B------------------C--------------------D--------------E------------------F-------------------G-
    John ---------- Smith -------- js@email.com -------- Jane -------- Smith --------- js@email.com ------ John
    Richard ------ McGee ---------j@email.com-----------Jim----------Samename ----jsn@email.com-------Rich
    Mary-----------Ladyface ------ms@email.com--------Steve -------Smith ----------ss@email.com-------Steve

    Ideally, for each row I'd like to search A and D for the string from column G. If it finds it, the cell and the two cells to the right are fine - but everything else is 'cleared' (not deleted).

    So the above table would look like:
    -A----------------B------------------C--------------------D--------------E------------------F-------------------G-
    John ---------- Smith -------- js@email.com --------------------------------------------------------------- John
    Richard ------ McGee ---------j@email.com-----------------------------------------------------------------Rich
    -------------------------- -------------------------------Steve -------Smith ----------ss@email.com-------Steve


    Any advice? The only tutorials or existing code I can find for searching for strings involves me copying to a new workbook - and things get confusing with the code there. I don't need to copy things - just clear them; all in the same workbook.

    Thanks for your time!
    Last edited by Discloner; 07-08-2014 at 01:12 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Search Row by Column value and Highlight Text - For each Row

    Hi,

    Probably best if you upload the workbook. The layout of your data is not clear.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    07-08-2014
    Location
    Burlington, VT
    MS-Off Ver
    2007
    Posts
    3

    Re: Search Row by Column value and Highlight Text - For each Row

    Hi Richard,

    Can do. Please see attached. Hopefully that helps clarify. Also I apologize for the slightly misleading title - In working through the explanation of what my result should be I thought it would be better to clear out the unneeded data rather than highlight the text (as it says in the title).
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Row by Column value and Highlight Text - For each Row

    Welcome to the Forum. Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-08-2014
    Location
    Burlington, VT
    MS-Off Ver
    2007
    Posts
    3

    Re: Search Row by Column value and Highlight Text - For each Row

    This worked perfectly - thanks John! Saved me SO Much time having to manually go through these.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search Row by Column value and Highlight Text - For each Row

    You're welcome. Glad to help out and thanks for the feedback. Please comply with Forum Rule No. 9.

    9. Acknowledge the responses you receive, good or bad. If your problem is solved, please say so clearly, and mark your thread as Solved: Click Thread Tools above your first post, select "Mark your thread as Solved". Or click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Dropdown option or Edit button will not appear -- ask a moderator to mark it.

+ 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] Macro needed to search for text, highlight row, then cut & paste to another worksheet
    By BoyBri in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-20-2013, 07:17 AM
  2. Search and highlight hits only in Column C
    By kenelder in forum Excel General
    Replies: 5
    Last Post: 06-12-2013, 11:44 AM
  3. Replies: 1
    Last Post: 07-26-2011, 06:48 AM
  4. Replies: 1
    Last Post: 09-19-2009, 08:09 PM
  5. Search and highlight only containing text
    By sajidbagi in forum Excel General
    Replies: 19
    Last Post: 07-23-2009, 07:22 AM

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