+ Reply to Thread
Results 1 to 6 of 6

Find similiar cells in rows, and move them togehter

  1. #1
    Forum Contributor
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    365
    Posts
    199

    Find similiar cells in rows, and move them togehter

    Hi!

    I am trying to create a macro that would compare certain columns in range. In those columns there are "keys", and even if the column is different the same key always means the same thing.
    I would like to move all similar keys to the same column, starting with the most common one and moving to the least common. The data can only be moved inside the original row, but column dosn't matter. Kind of like so:
    ¨
    EXCEL_2018-09-14_06-50-58.png

    Also, the key values are connected to the "trash", so when I move the key I need to move the whole range of cells inside the row to the next key.
    I don't have any code yet, I was thinking that this should probably be done with loading all cell values from key-columns to an array with the cell value and location stored, but that is as far that I have come up with it.

    Does anyone have any ideas on how to accomplish this?

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Find similiar cells in rows, and move them togehter

    Attach a sample workbook, showing your expected result mocked-up.

    Go Advanced -> Manage Attachments -> Upload

  3. #3
    Forum Contributor
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    365
    Posts
    199

    Re: Find similiar cells in rows, and move them togehter

    Ok, here! Hope it helps.
    Attached Files Attached Files

  4. #4
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Find similiar cells in rows, and move them togehter

    But in your output you have Key4 and Key8 in the same column?

    Maybe some more "real-world" desensitised sample source data might make sense.

  5. #5
    Forum Contributor
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    365
    Posts
    199

    Re: Find similiar cells in rows, and move them togehter

    Quote Originally Posted by kersplash View Post
    But in your output you have Key4 and Key8 in the same column?

    Maybe some more "real-world" desensitised sample source data might make sense.
    Yes, because there is only 1 of them and the data need to be filled from left to right.
    So basically the macro should try to group up as many key values as it can, but the rest will be filled where it can.
    I will start now to compile a real-world example with real data, hopefully, it will help

  6. #6
    Forum Contributor
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    365
    Posts
    199

    Re: Find similiar cells in rows, and move them togehter

    The more I think about this, the more problems I see. I think this is not worth the effort. Sorry for wasting your time.

+ 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. Using the IF and VLOOKUP function togehter
    By Tiny3 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-10-2014, 07:55 AM
  2. have reference cells move in rows while I move in columns
    By gryffin13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2011, 09:33 AM
  3. Highlight/ Mark similiar cells
    By 00Able in forum Excel General
    Replies: 2
    Last Post: 01-25-2011, 08:21 PM
  4. How to combine similiar rows
    By minimacros in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-10-2010, 08:22 PM
  5. A macro to combine and sum similiar cells
    By VBAnoob88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-22-2010, 09:12 AM
  6. Combining Similiar Cells
    By VBAnoob88 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-22-2010, 08:44 AM
  7. Condensing similiar rows into one row
    By Requiescat in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-21-2008, 09:54 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