+ Reply to Thread
Results 1 to 8 of 8

Conditional, moving cells

  1. #1
    Registered User
    Join Date
    11-16-2009
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    2

    Conditional, moving cells

    Okay, I'm not good at excel but my boss wants me to figure out a problem for him.

    So, I have a spreadsheet. Its about 48000 records

    Most of the records are duplicates, but only because they have multiple dependents and multiple jobs.

    So basically its like this. I'm using commas to seperate cells.

    SSN, Name, Employer, Dependent SSN
    1245, Jane, Walmart, 4321
    1245, Jane, Walmart, 1234
    1245, Jane, Walmart, 3214
    1246, John, Costco, 1122
    1246, John, HomeDepot, 1122

    Like that so same person but employer or Dependent SSN changes
    We want to take Employers/Dependent and add it to the previous line.
    so it would look like
    SSN, Name, Emp1, Emp2, Emp3, Dep1, Dep2, Dep3
    1245, Jane, Walmart, 4321, 1234, 3214
    1246, John, Costco, HomeDepot, 1122

    To make things more complicated we have information like employer address that needs to be moved with the Employer name, and Dependent Relationship that needs to be pulled with the Dep SSN.

    Thanks in advance-- Josh
    Last edited by middlemonster; 11-16-2009 at 04:01 PM.

  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: Conditional, moving cells

    Hi MiddleMonster. Welcome to the forum.

    Rather than pick at this a little at a time, you should upload a sample data sheet that shows all the hurdles that need to be overcome, all at once. Use a real sheet and shorten it to a 100 rows or so and change the names to "sanitize" it.

    Then mockup exactly what the results should be based on the sample data so we can compare directly.

    Click GO ADVANCED and use the paperclip icon to post up your workbook.
    _________________
    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
    11-16-2009
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Conditional, moving cells

    Should be attached now!

    There are 2 worksheets, 1 for the Original the other is the new format.

    I hope you get my drift.
    Attached Files Attached Files

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

    Re: Conditional, moving cells

    This is doable and I'll look at it of course. But take a note from an impartial 3rd party...your "Original" is SO EASY to read...the "How I want it to be" is a complete pain to read.

    I wouldn't wish the new format on anyone else.

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

    Re: Conditional, moving cells

    Ok, here's a macro that will reformat your sheet:
    Please Login or Register  to view this content.
    ===========
    How to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use.
    ==========

    Press Alt-F8 and select the ReformatData macro from the popup window.

  6. #6
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Conditional, moving cells

    Hi Jerry!
    I am actually trying to do the same thing except I need to move all of the content in U column with same B value into one single cell after the duplicates elimination.

    I ve attached a sample file includes "before and after" with this post.

    Please Help and I hope you rockets go further and higher!

    Many many thanks!

    Chris

    Sample for Jerry.xlsxSample for Jerry.xlsx






    Quote Originally Posted by JBeaucaire View Post
    Ok, here's a macro that will reformat your sheet:
    Please Login or Register  to view this content.
    ===========
    How to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The macro is installed and ready to use.
    ==========

    Press Alt-F8 and select the ReformatData macro from the popup window.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Conditional, moving cells

    Aviatecar,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  8. #8
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Conditional, moving cells

    Quote Originally Posted by arlu1201 View Post
    Aviatecar,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

    Hi Arlette:

    Thank you for letting me know this and sorry for messing up this thread.

    So I ve started a new thread: http://www.excelforum.com/excel-prog...88#post2843088

    Please stop by and take a look.

    Thank you,

    Chris

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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