+ Reply to Thread
Results 1 to 3 of 3

Replace cells with multiple search critera

  1. #1
    Registered User
    Join Date
    11-09-2013
    Location
    Texas
    MS-Off Ver
    Excel 2008
    Posts
    2

    Replace cells with multiple search critera

    I've searched around, and I can't find an answer for this...

    I have a pretty big spreadsheet of names of ships and other data, and I realized that some of the names are duplicate. I've made a separate table with all of the unique names, and added numbers to differentiate. So say I want to replace the name of any record in the second table that is ShipName="Jason", ShipType="sloop", Year>=1760 & <=1780 with ShipName="Jason (1)".

    I'm assuming this can be done with a VBA Replace, but I'm new to VBA and haven't been able to figure out how to use multiple search criteria. Any help is appreciated!


    ShipName ShipType FirstYear LastYear
    Jason (1) sloop 1760 1780
    Jason (2) frigate 1770 1800

    ShipName ShipType Year
    Jason sloop 1760
    Jason sloop 1761
    Jason sloop 1762
    Jason sloop 1773
    Jason frigate 1770
    Jason frigate 1775
    Jason frigate 1780

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Replace cells with multiple search critera

    Is all your data in the same columns?

  3. #3
    Registered User
    Join Date
    11-09-2013
    Location
    Texas
    MS-Off Ver
    Excel 2008
    Posts
    2

    Re: Replace cells with multiple search critera

    It looks like this. I gave the columns unique names to make it clearer

    ShipNameNew ShipTypeNew FirstYear LastYear ShipNameOriginal ShipTypeOriginal YearOriginal
    Jason (1) sloop 1760 1780 Jason sloop 1760
    Jason (2) sloop 1770 1800 Jason sloop 1761
    Jason sloop 1762
    Jason sloop 1773
    Jason frigate 1770
    Jason frigate 1775
    Jason frigate 1780

+ 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: 2
    Last Post: 06-21-2013, 08:38 PM
  2. [SOLVED] Multiple Search and Replace
    By Melissa Alex in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-14-2012, 12:05 PM
  3. [SOLVED] How to Find and Replace only if critera is at the end of the string?
    By windcloud2 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-02-2012, 02:39 PM
  4. [SOLVED] Search and replace in multiple columns
    By ajm1949 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-01-2012, 03:56 AM
  5. Search named range for multiple matches to critera and return date & values
    By a.mack123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2011, 10:07 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