+ Reply to Thread
Results 1 to 4 of 4

Find and replace string if value find in column

  1. #1
    Registered User
    Join Date
    04-14-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    28

    Find and replace string if value find in column

    Hi all,

    I have two sheets (Sheet1 and Sheet2).

    I would like a VBA to look at values in column A in Sheet2 and if found it replace with any other text or remove this value in column A in Sheet1.

    So as a result I would have White, Black, Orange, White, without a, b, c, d, as these values are in Sheet2.


    Sheet1
    Column A
    a white
    b black
    d white
    c orange


    Sheet2
    Column A
    a
    b
    d
    c




    Thanks a lot!

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Find and replace string if value find in column

    I know this is a simplistic example, but you need more detail. For example, what makes the "a" out front of white any different than the "a" in the middle of orange?

    You'll need to provide more rules, along the lines of "if found and there's a space after it" or whatever rules your real data abides by.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    04-14-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Find and replace string if value find in column

    only exact match should be removed/replaced. In this case "a", "b", "c", "d" are going to be replaced in Sheet1 as they are in Sheet2. The "a" in the middle of orange is not going to be replaced, as "orange" is not in Sheet2.

    Cheers

  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: Find and replace string if value find in column

    Does this help?

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 04-07-2016 at 01:34 PM.

+ 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. Replies: 3
    Last Post: 11-25-2014, 06:08 AM
  2. Find a string in certain column and replace with range of cells
    By joker25 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2014, 09:25 AM
  3. [SOLVED] Find a string by VBA Regular Expression and replace a part of that string
    By taps in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-25-2013, 11:08 AM
  4. [SOLVED] VBA to Search a Text String, Find a Value listed in another column and replace the text
    By Jschrod303 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 08:56 PM
  5. The string of "Find what:" in Find and Replace dialog box to always highlight itself
    By chrisneu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-23-2009, 09:04 AM
  6. Find / Replace in a string
    By Basu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-12-2006, 10:55 AM
  7. Replies: 0
    Last Post: 10-13-2005, 02:05 PM

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