+ Reply to Thread
Results 1 to 3 of 3

Macro to convert lists in a row to multiple rows with single items

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    Boston
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macro to convert lists in a row to multiple rows with single items

    I am trying to convert a sheet that has cells with a list of items separated by commas into multiple rows with one item in each cell.

    So:

    Name Groceries
    Sally bread, eggs, cheese
    Sue eggs
    Amy bread, sugar


    Will get converted to:

    Name Groceries
    Sally bread
    Sally eggs
    Sally cheese
    Sue eggs
    Amy bread
    Amy sugar

    Can someone give me a macro that will do this, that I can re-use whenever I get new data?
    Thanks, Gil

  2. #2
    Forum Guru Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Macro to convert lists in a row to multiple rows with single items

    Assuming your data is in A1, Sheet1, then try:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Administrator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 365 Version 2211 (Build 15813.20002) Win 11 Home 64 Bit
    Posts
    22,117

    Re: Macro to convert lists in a row to multiple rows with single items

    An alternative:

    Highlight column A. Click on Data on the Ribbon. Choose Text to Columns. Delimited. Space and comma.
    Then run this VBA code.

    Please Login or Register  to view this content.
    Alan


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. Convert multiple rows to single row
    By wlowe97 in forum Excel General
    Replies: 4
    Last Post: 02-05-2014, 11:37 AM
  2. Convert multiple rows for a company to a single row
    By Chloe13 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 11-08-2012, 09:55 AM
  3. Replies: 0
    Last Post: 09-26-2012, 10:33 AM
  4. Convert multiple rows to one single column
    By Rashme in forum Excel General
    Replies: 2
    Last Post: 09-12-2012, 03:20 PM
  5. Convert multiple row to single rows
    By rukia in forum Excel General
    Replies: 6
    Last Post: 05-20-2010, 04:46 AM
  6. Combining single rows into multiple lined items
    By bread in forum Excel General
    Replies: 1
    Last Post: 08-31-2009, 12:27 PM
  7. Convert single colum/multiple rows to multiple colums.
    By merlinxl in forum Excel General
    Replies: 15
    Last Post: 06-12-2008, 07:01 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