+ Reply to Thread
Results 1 to 7 of 7

Moving Data From One Cell To Many

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Moving Data From One Cell To Many

    I have a worksheet with roughly 7,000 rows on it where the data is all crammed in column A. It just sits on top of each other with a line break. I added in the
    Please Login or Register  to view this content.
    function, but when there is a line break it rams the data into each other with no break. For example my data currently looks like this
    Please Login or Register  to view this content.
    When I use Clean() it puts the data like this Blue Bell1122 Red Light Stop SignSante Fe, NM 22222. Question at hand -> is there a worksheet function or even VBA that would parse out the Name, Address, City, State and zip that could move them all into there own individual cell?

    The data always comes in this format, the only difference is sometimes there is no zip code, but the layout is exactly the swame.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,486

    Re: Moving Data From One Cell To Many

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and click "manage attachments" to open the upload window.



    To add a file to a post

  3. #3
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Moving Data From One Cell To Many

    Hi Jo- Assuming you want to parse your data into columns B-F, and that your data starts on row 1...
    Make sure the worksheet you want to change is selected ( = currently active sheet).
    Paste this into a standard module in your workbook and run it.
    Please Login or Register  to view this content.
    Hope this helps-Lee
    Last edited by leelnich; 04-07-2017 at 02:30 PM.

  4. #4
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Moving Data From One Cell To Many

    @leelnich - I ran your macro and it works for about 95% of the cases. I discovered that in the 5% of the cases that it throws an error there is an extra line at the bottom of garbage data so those problems read like
    Please Login or Register  to view this content.
    Is there a way to ignore the 4th line if it exists?

  5. #5
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Moving Data From One Cell To Many

    if your third row is ALWAYS city/state/zip, then this will work. If you have any valid fourth rows, I'll have to find a way to distinguish good from bad eg. Are there ever any NUMERALS in the discardable text?
    Please Login or Register  to view this content.
    I'm signing off, I'll check back tomorrow about 10 am. Take care- Lee
    ps. I lived in Atlanta for years. Loved it.

  6. #6
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Moving Data From One Cell To Many

    No the 4th row is always text and is always discardable (garbage data).

  7. #7
    Forum Expert leelnich's Avatar
    Join Date
    03-20-2017
    Location
    Delaware, USA
    MS-Off Ver
    Office 2016
    Posts
    2,807

    Re: Moving Data From One Cell To Many

    Ok, great! Did the code in post #5 work? Note that the zip code is NOT required, I worded that poorly.
    Last edited by leelnich; 04-08-2017 at 11:38 AM.

+ 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. moving data to another sheet based on data in a specific cell
    By Dandrewhill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-20-2016, 03:30 AM
  2. Auto-Converting Cell Value to link & moving rows of data based on cell value
    By Th3Forgotten in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-15-2013, 08:05 AM
  3. Moving multiple data from one cell (Vertically) to another cell (Horizontally)
    By pzickert in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 04:45 PM
  4. Replies: 0
    Last Post: 05-21-2012, 06:59 AM
  5. Moving data to another cell
    By biznez in forum Excel General
    Replies: 4
    Last Post: 12-14-2009, 12:54 PM
  6. Replies: 1
    Last Post: 04-26-2009, 08:16 PM
  7. Moving data from one cell to another
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-26-2005, 04:06 PM

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