+ Reply to Thread
Results 1 to 6 of 6

Parsing data to separate columns

  1. #1
    Registered User
    Join Date
    11-06-2012
    Location
    Portland, OR
    MS-Off Ver
    Excel 2010
    Posts
    6

    Parsing data to separate columns

    Hello.

    I can write a simple macro but not sure how to tackle this one. Attached is an Excel workbook. Column A has a few pieces of information: 1. Physician Name 2. Address 3. Phone Number and 4. Fax number 5. Blank rows. Some addresses have 2 lines and some have 1 line.

    I need a macro that would put the address, phone number, and fax number all in separate columns. I want to end up with a spreadsheet that has all information in separate columns and Column A only left with physician name. The challenge is that some Column A information sets have 1 blank row and some more than that.

    Any advice? Greatly appreciated.

    Thank you!

    Kate
    Attached Files Attached Files
    Last edited by JBeaucaire; 04-30-2013 at 07:24 PM. Reason: Corrected Title, as per forum rules. Please take a moment to read the Forum Rules, link is above in the meny bar.

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

    Re: Parsing data to separate columns

    A sample workbook like this should have two sheets, BEFORE and AFTER. Show us a mockup of the expected results from a sample set of data so there is no guesswork on the goal line. You need only include enough BEFORE data to fully represent all the variations in the data.
    _________________
    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-06-2012
    Location
    Portland, OR
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Parsing data to separate columns

    Thank you for feedback. Here is the corrected Excel Workbook. Sheet 2 shows the desired outcome (the section that is highlighted in yellow is what the rest of the data should look like - the address, phone and fax all in one line).

    Please let me know if I omitted anything else.

    Thank you!

    Kate
    Attached Files Attached Files

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

    Re: Parsing data to separate columns

    This macro gets you 99.9% of the way there. Scan through the results and delete out the few rows that shouldn't be there.
    There are one or two rows that are just too different, but I left the original data so you can grab the missing phone numbers on those one or two.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-06-2012
    Location
    Portland, OR
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Parsing data to separate columns

    This was perfect. Thank you sooo much!

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

    Re: Parsing data to separate columns

    I've marked this thread as SOLVED for you.
    Next time, select Thread Tools from the links above and mark this thread as SOLVED. Thanks.

+ 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