+ Reply to Thread
Results 1 to 2 of 2

Need to duplicate rows of data based upon a single cell value

  1. #1
    Registered User
    Join Date
    10-13-2015
    Location
    Fort Worth, Texas
    MS-Off Ver
    MS Office 365 on Mac
    Posts
    5

    Need to duplicate rows of data based upon a single cell value

    I'm desperate. Working on Mac vs. 15.17; I had a macro that use to work in a previous version of Excel. But I cannot get it to work now. I do not know VB or code. Can anyone please help me?

    I have several spreadsheets that all have over 20,000 rows of data.
    I need to expand the sheet based upon one of the columns.
    The sheet has a column (X) of data with years separated by commas. Example: 2000, 2001, 2015
    the number of years is varied.
    I need a macro that will look at this cell and create duplicated rows of data based how many years exist in the cell; Once the data is duplicated it needs to have just a single year in the (x) Column

    Example:
    Top row represents original row of data
    Next three rows is the result I need to achieve.

    cell A cell B cell C cell D cell E cell F cell G cell H cell I cell J cell K cell L cell M cell N cell O cell P cell Q cell R cell S cell T cell U cell V cell W 2000, 2001, 2015
    cell A cell B cell C cell D cell E cell F cell G cell H cell I cell J cell K cell L cell M cell N cell O cell P cell Q cell R cell S cell T cell U cell V cell W 2000
    cell A cell B cell C cell D cell E cell F cell G cell H cell I cell J cell K cell L cell M cell N cell O cell P cell Q cell R cell S cell T cell U cell V cell W 2001
    cell A cell B cell C cell D cell E cell F cell G cell H cell I cell J cell K cell L cell M cell N cell O cell P cell Q cell R cell S cell T cell U cell V cell W 2015

    Here is example from spreadsheet.

    Model Object ID Section Name Item Group ID Item Group Name Make Object ID Make Name Model Name Model Years Color|Fiment Color Engine Szie Footnote Kits Required O.E.M. Position Spring Rate Model Name Path Item Object ID Item Name Item Brand Item Description Item Segment Unique Model Names Year List
    1719317 Control 53762 Clutch Cable 1718762 Arctic Cat 400 DVX 04-08 /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Arctic Cat/400 DVX 53685 414484 QuadBoss® ATV Clutch Cable ATV|UTV 400 DVX 2004, 2005, 2006, 2007, 2008
    1719318 Control 53762 Clutch Cable 1718763 Can-Am DS 450 10-15 Red /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Can-Am/DS 450 53726 414525 QuadBoss® ATV Clutch Cable ATV|UTV DS 450 2010, 2011, 2012, 2013, 2014, 2015
    1719319 Control 53762 Clutch Cable 1718763 Can-Am DS 450 EFI X mx 10-12 xx /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Can-Am/DS 450 EFI X mx 53726 414525 QuadBoss® ATV Clutch Cable ATV|UTV DS 450 X mx 2010, 2011, 2012
    1719320 Control 53762 Clutch Cable 1718763 Can-Am DS 450 EFI X xc (2) 09-12 x /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Can-Am/DS 450 EFI X xc (2) 53726 414525 QuadBoss® ATV Clutch Cable ATV|UTV DS 450 X xc 2009, 2010, 2011, 2012
    1719321 Control 53762 Clutch Cable 1718763 Can-Am DS 450 STD/X 08-09 /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Can-Am/DS 450 STD@fs:X 53726 414525 QuadBoss® ATV Clutch Cable ATV|UTV DS 450, DS 450 X 2008, 2009
    1719322 Control 53762 Clutch Cable 1718763 Can-Am DS 450 X xc/X mx 2015 xx /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Can-Am/DS 450 X xc@fs:X mx 53726 414525 QuadBoss® ATV Clutch Cable ATV|UTV DS 450 X mx, DS 450 X xc 2015
    1719323 Control 53762 Clutch Cable 1718764 Honda ATC250R 1986 /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Honda/ATC250R 53706 414505 QuadBoss® ATV Clutch Cable ATV|UTV ATC250R 1986
    1719324 Control 53762 Clutch Cable 1718764 Honda ATC250R (2) 1985 /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Honda/ATC250R (2) 53706 414505 QuadBoss® ATV Clutch Cable ATV|UTV ATC250R 1985
    1719325 Control 53762 Clutch Cable 1718764 Honda ATC250R (3) 82-84 x /Structures/Publication/Cat_QuadBoss/Control/Cable Assemblies/Clutch Cable/Honda/ATC250R (3) 53688 414487 QuadBoss® ATV Clutch Cable ATV|UTV ATC250R 1982, 1983, 1984


    Here is the code that use to work.
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 06-22-2016 at 02:20 PM. Reason: Added missing CODE tags. Please read and follow the Forum Rules, link above in the menu bar. Thanks.

  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: Need to duplicate rows of data based upon a single cell value

    'ROWS TO COLUMNS
    Here's a published macro for expanding rows of data to multiple rows parsing out the delimited values in one column while duplicating all the others.For your column X, the only tweak you need should be:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 12-26-2019 at 03:56 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!)

+ 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. Replies: 1
    Last Post: 04-06-2016, 07:02 AM
  2. [SOLVED] Multiple values in single cell (known column) split into rows with duplicate information
    By bwashbourne in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-06-2015, 05:00 PM
  3. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM
  4. [SOLVED] Delete rows based on duplicate cell, but leaving first and last duplicate.
    By LadyNicole in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-28-2013, 05:07 AM
  5. Remove duplicate data in single cell
    By GenericPat in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-20-2012, 12:32 PM
  6. Return duplicate row values in new table based on single cell value
    By VDubz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2011, 10:04 AM
  7. Delete multiple rows of data based on criteria in a single cell
    By slaga9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-12-2011, 03:41 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