+ Reply to Thread
Results 1 to 3 of 3

Add a column next to current cell

  1. #1
    Registered User
    Join Date
    07-17-2019
    Location
    United States
    MS-Off Ver
    Office 2016
    Posts
    5

    Add a column next to current cell

    I have a checker which cheks the discrepancy between columns based on the ID number. The problem is, this concatenates the values but what I would like to achieve is: if they have the same ID number, everytime a unique value in the same column is found, it should insert a new column on the right side where the unique value should be outputted.

    For example:
    | Employee ID | Status |
    E100 Deactivated
    E100 Activated

    should be:
    | Employee ID | Status | Status (2) |
    E100 Deactivated Activated

    Instead of:
    | Employee ID | Status |
    E100 Deactivated, Activated

    I have inserted below what I have done so far. I would really appreciate help in this.

    Please Login or Register  to view this content.
    Last edited by dubumochi; 07-17-2019 at 10:10 AM.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Add a column next to current cell

    Hi there,

    Could you post a desensitised version of your workbook so that I can test a proposed solution?

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    07-17-2019
    Location
    United States
    MS-Off Ver
    Office 2016
    Posts
    5

    Re: Add a column next to current cell

    Quote Originally Posted by Greg M View Post
    Hi there,

    Could you post a desensitised version of your workbook so that I can test a proposed solution?

    Regards,

    Greg M
    Hi Greg, I'm not quite sure if I'm following the forum rules by quoting you but here's a sample data I'm using to easily see if the code I'm doing is working properly. This is assuming that header "Gym Name" will be the primary key or connector for these values. As much as I would like to make a workbook as close to the original one, it's sadly Active Directory data and I'm not quite well versed in it. I would like to note that due to time constraint, the part of the code I posted above happens after the "consolidation" button is clicked. That means, when they're consolidated into one sheet it already includes the duplicates and the discrepancies. Then, if by some miracle I would make that desired output work, it should be placed after the consolidation so what the user will see is the "clean" version of it. Although there's no solution for it yet, I appreciate that you took the time to look at my problem as I'm in a rut right now and can't really code to save my life.

    For some reason, the attachment doesn't work (maybe because I'm new) so I'll be dropping it this link here: ufile.io/p5xq6cpa (can't format it to url yet as I'm new).


    Also, while I was looking for help, I have updated the code as well so the "columnToMatch" variable doesn't look for a number now, instead it looks for 1 column name. I have also put an all caps comment to note where I think this code goes wrong.

    Please Login or Register  to view this content.

+ 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. Current cell row column highlight
    By rachelwahid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-25-2019, 11:52 AM
  2. Replies: 12
    Last Post: 07-10-2015, 01:18 AM
  3. Replies: 5
    Last Post: 09-26-2014, 10:51 AM
  4. [SOLVED] How to select 4th cell down in current column?
    By TheLittlePrince in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-28-2013, 07:00 AM
  5. [SOLVED] From Activecell, Paste cell value on current row into column A, Column B, D, and G
    By bg_enigma1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-08-2012, 03:43 PM
  6. Replies: 9
    Last Post: 12-09-2011, 04:39 AM
  7. Looking up a cell that is left of the current column
    By ynot2010 in forum Excel General
    Replies: 3
    Last Post: 02-06-2011, 11:24 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