+ Reply to Thread
Results 1 to 6 of 6

If data exists on Sheet2/colB but not Sheet1/colA, add it.

  1. #1
    Registered User
    Join Date
    02-10-2014
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    25

    If data exists on Sheet2/colB but not Sheet1/colA, add it.

    Not sure where to start ...I need a VBA script to do the following (when run) -

    To add to an existing list of "City" names in Sheet1 (colB), based on any new "City" found on Sheet 2 (colA)

    - Sheet2 constantly changes (data comes and goes).
    - I need Sheet1 to be static, meaning, if I delete Sheet2, I do not lose any data on Sheet1.

    I think I want to say, but not sure where to start:
    If City exists on Sheet2 (column A), but does not exist on Sheet1 (column B), add the City to Sheet1(column B). -I just need the City Name, not all of the user data.

    See attached example data.

    Note: Sheet2 can contain anywhere from 450 to 30000 rows of data.

    Any help would be appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: If data exists on Sheet2/colB but not Sheet1/colA, add it.

    See attached
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    02-10-2014
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    25

    Re: If data exists on Sheet2/colB but not Sheet1/colA, add it.

    Thank-you! It works! Though, I may need to remove the dictionary element since it found Toronto and TORONTO

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: If data exists on Sheet2/colB but not Sheet1/colA, add it.

    Try
    If another format is needed just tell it

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-10-2014
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2013
    Posts
    25

    Re: If data exists on Sheet2/colB but not Sheet1/colA, add it.

    Yes...I think that worked.. It did copy only unique values. Though, the copied values are in uppercase, but I think I can work with that (or if needed, maybe add StrConv). Thank-you!

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: If data exists on Sheet2/colB but not Sheet1/colA, add it.

    "the copied values are in uppercase," yes, if you need another format just tell 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. Replies: 6
    Last Post: 07-25-2013, 02:58 PM
  2. Replies: 5
    Last Post: 01-29-2013, 03:46 PM
  3. SUM(ColB Where ColA=y)
    By brianmo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-06-2007, 03:10 PM
  4. [SOLVED] match colC to ColA, put row from ColB for 'answer'
    By MatthewTap in forum Excel General
    Replies: 4
    Last Post: 10-14-2005, 02:38 PM
  5. want to count in two columns; countif (colA=x AND colB=y)?
    By Heather Murch in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-18-2005, 10: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