+ Reply to Thread
Results 1 to 13 of 13

Search for similar cells in column and set corresponding value

  1. #1
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Search for similar cells in column and set corresponding value

    Hi all,

    I have a list of codes in column A, I fill columns B,C,D with "x", depending on the situation.
    I need a program that finds similar codes in column a and fills in the corresponding cell like in the attached image so I don`t have to search previous inputs to set the same value.

    I do not want to use formulas because they take a lot of time to calculate, I have 9000+ codes to search through.

    Thank you!
    Attached Images Attached Images

  2. #2
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    you would have to specify "similar codes" and maybe an example excel sheets with some made up codes. The problem is that "similar" might be both codes have an x in them or they should have at least 5 digits which should be the same. Thos scenarios are very different and will yield different results.
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    Thanks for the quick reply.

    Sorry for me being ambiguous in the first post. I meant I needed a script to find the exact code duplicate and fill in the corresponding cell, either B or C or D or E with the corresponding value. So the script needs to find other codes like the already marked ones and complete accordingly.
    There isn`t really much else to say.

    I attached a sample workbook.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    Have a look but many codes don't have exact copies of your previously marked x's and in your marked ones are duplicates.
    Attached Files Attached Files
    Last edited by Decar; 02-12-2014 at 05:54 AM.

  5. #5
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    I really appreciate your efforts!

    Let me explain more clearly.
    I have the product codes in column A. Columns B/C/D/E represent locations for that code. For example B is central warehouse, C is regional warehouse, D is small warehouse and E is all warehouses.
    As I complete locations in the file, I want the script to automatically complete below any occurences of the same code with the same location so I don`t have to do the same work a lot of times.

    Is it clear?

    Thank you!
    Last edited by Avantime; 02-12-2014 at 06:14 AM.

  6. #6
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    *Duplicate*

  7. #7
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    so lets take the test sheet I uploaded. You want to plug in codes in the little table to the right for a,b etc. and then the code will check each code if it is the same as in one of the codes you specified there.


    VBA has to somehow know that code N4965017 is all warehouses or small or regional. There must be a reference where vba will look where to put the x

  8. #8
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    I set where the product will be located manually. If there is nothing set on a specific code VBA has nothing to set on other occurances.
    For example if for the first code (N4963029) I place an x on the same row and under C column, I need all other occurances below of the same code to have an x on the same column.

  9. #9
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    that sounds quite complicated. The only way I could think of helping you with this is to create a new list next to where each code is. In this list each code will be included only once and there you will have to choose the warehouse for each code. If a code is not marked it will not be assigned.

  10. #10
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    No, every code has multiple applications, hence the multiple occurrences..

  11. #11
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    I'm a bit confused. I meant that you specify for each code in which warehouses it belongs in a separate table. According to this separate table the main table will be updated and there might be that code (N4963029) is in 0, central and regional or all warehouses together.

    But if you want code (N4963029) to be in warehouse central in the beginning and in between in warehouse regiona + central then there is no logic VBA can build upon to automate the process.

  12. #12
    Registered User
    Join Date
    02-12-2014
    Location
    home
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Search for similar cells in column and set corresponding value

    Two occurrences of the same code will not have different locations. I don`t want to copy the code in a separate table.

  13. #13
    Forum Contributor
    Join Date
    11-05-2013
    Location
    Germany
    MS-Off Ver
    Excel 2013
    Posts
    120

    Re: Search for similar cells in column and set corresponding value

    I think I get what you want now ^^. The table for the unique codes would be generated automatically. Maybe I have some more time later then I will try to help you more

+ 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] colorize rows with similar sorted cells in column
    By Mally in forum Excel General
    Replies: 8
    Last Post: 08-12-2013, 12:18 PM
  2. filter only one cell from various similar cells in a column
    By marvinlajiant in forum Excel General
    Replies: 2
    Last Post: 07-27-2011, 10:14 PM
  3. Find and highlight similar cells in a column
    By martinez_pedro in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-12-2011, 10:03 AM
  4. Replies: 2
    Last Post: 04-02-2009, 01:55 AM
  5. [SOLVED] [SOLVED] Copying cells with similar column values
    By mohd21uk via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-15-2006, 04:35 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