+ Reply to Thread
Results 1 to 5 of 5

Need to extract text from within multiple strings and arrange it in a single column

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    Siloam Springs, Arkansas, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Need to extract text from within multiple strings and arrange it in a single column

    When I converted text to Excel from a .txt format, each cell contained a whole line of text. I need to extract very specific pieces of information (the parts contained in brackets) from each line and list all of these in a single column. The attached spreadsheet should make it clear what I am trying to do. Could anyone help me write a macro to accomplish this? Thank you!

    Sample.xlsm

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Need to extract text from within multiple strings and arrange it in a single column

    Hello

    This macro will do what you want. It has been added to the attached workbook.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Need to extract text from within multiple strings and arrange it in a single column

    sampflederer,

    Welcome to the Excel Forum.

    Thanks for the workbook.

    The following macro will do what you have requested based on the raw data in your workbook.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code
    2. Open your NEW workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the ExtractPartsOfSpeech macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    08-01-2013
    Location
    Siloam Springs, Arkansas, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Need to extract text from within multiple strings and arrange it in a single column

    Thank you both! I tried Leith's formula first, and it worked perfectly for what I was wanting to do.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Need to extract text from within multiple strings and arrange it in a single column

    Hello sampflederer,

    You're welcome.

+ 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. Using multiple text strings in a single cell as Pivot labels
    By rsfx in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 11-14-2012, 08:09 AM
  2. Extract multiple values from long strings of text
    By Patrick791 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-05-2012, 04:17 AM
  3. Extract data from text strings and move to new column
    By FN2010 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-13-2010, 03:59 AM
  4. Extract strings intelligently from single cell
    By berny99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-17-2008, 11:30 PM
  5. Finding Duplicate text strings with a single column
    By Ed P in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2005, 12:06 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