+ Reply to Thread
Results 1 to 8 of 8

Align Duplicates Or Matching Values In Two Columns With VBA Code

  1. #1
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Align Duplicates Or Matching Values In Two Columns With VBA Code

    Hello,

    I have an excel sheets with 10 columns the first 7 columns are one group and the other 3 columns are second group. I'm trying to compare the 2 groups and align duplicates in same line based on cells in (A) and cells in (H).

    So if Cell A1 = H3 align A1-G1 with H1-J1 and so on. Any example code please?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    On this page are numerous "Line Up Matches" puzzles and VBA solutions. The one you would most likely use and adapt is Problem #4.

    Line-up-matches
    Last edited by JBeaucaire; 12-26-2019 at 03:44 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    I tried before this concept and edited the code so it compares A with H however it didn't work.

    Please Login or Register  to view this content.
    When run the marco I asked it to compare G with H for simplicity however the ending result is wrong. It clears certain cells and aligns wrong duplicates.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  5. #5
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    Thank you for your reply. I've attached a sample workbook with dummy data with the code in it.

    What I'm looking for exactly compare G to H let's say if G1 = H79 then align A1:G1 with H79:J79 since both are 2 groups and should have the relative data the outcome will become A1:J1 = A1:G1 + H79:J79.

    Thank you for your support
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    Try
    Please Login or Register  to view this content.
    Edit: Fixed a bug
    Last edited by jindon; 10-29-2017 at 11:47 AM.

  7. #7
    Registered User
    Join Date
    05-10-2017
    Location
    London, England
    MS-Off Ver
    2013
    Posts
    23

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    Thank you, you saved my day. As I can see the results are parsed in a new sheet.
    Last edited by webiscore; 10-29-2017 at 12:08 PM. Reason: Removing Quote

  8. #8
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Align Duplicates Or Matching Values In Two Columns With VBA Code

    You are welcome.

    1)
    Don't quote whole posts -- it's just clutter. If you are responding to a post out of sequence, limit quoted content to a few relevant lines that makes clear to whom and what you are responding

    For normal conversational replies, try using the QUICK REPLY box below.

    2)
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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] Align matching values in columns, and an additional column should follow!
    By Hatmpatn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-14-2017, 10:26 PM
  2. Align Rows based on Matching Values in 2 Columns
    By cmv040 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-05-2016, 07:49 PM
  3. Matching values in two columns - one column has duplicates
    By morganz in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-08-2015, 10:38 AM
  4. Excel 2007 : Align rows by matching values in other columns
    By jhanson60 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-14-2014, 11:27 PM
  5. Align 3 columns with 2 columns of matching data
    By bearnbillie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-04-2012, 08:33 AM
  6. matching values in columns that contain duplicates
    By jellybean in forum Excel General
    Replies: 8
    Last Post: 08-14-2006, 09:20 PM
  7. [SOLVED] Filtering Columns to Align Matching Data
    By Casino Guy in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-15-2005, 12:05 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