+ Reply to Thread
Results 1 to 6 of 6

Extract all text in brackets into new row

  1. #1
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    162

    Extract all text in brackets into new row

    I work at a law firm and I need a relatively quick way of extracting data within brackets and put each instance onto the next new row. The legal documents have various legal codes and cites, that are various lengths. They are created in word, however when the are done, they often need to extract all of the data (which could be put into bracket like {} and get extracted. Each set of brackets would then need to be on the next empty row down. I put a sample file together. Column A has sample text with the curly brackets around the code that I need to extract, and then on column C it has the intended output.

    Can anyone help with this or send me to a link to a file where someone has done something like this?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,357

    Cool Hi ! Try this !


    As a starter :

    PHP Code: 
    Sub Demo1()
             
    Dim VS$(), N&, R&
        For 
    Each V In ActiveSheet.UsedRange.Columns(1).Value
                S 
    Split(V"{")
            For 
    1 To UBound(S)
                
    1
                Cells
    (R2).Value Split(S(N), "}")(0)
            
    Next
        Next
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon Add Reputation !

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

    Re: Extract all text in brackets into new row

    You could use Power Query:
    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...

  4. #4
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    162

    Re: Hi ! Try this !

    Thank you, that works great!

    I've never used Power Query, but the VBA code worked exactly as I needed it.
    Last edited by Delta729; 04-18-2018 at 12:25 PM.

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    5,357

    Thanks for the rep' !

  6. #6
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    162

    Re: Extract all text in brackets into new row

    No problem and many thanks. I was looking all over doing a Google search and couldn't find anything. But someone here was able to get what I needed in no time at all.

+ 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. Extract text from second set of brackets
    By km3033 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-01-2018, 04:07 PM
  2. [SOLVED] How to extract text between brackets/parentheses in Excel?
    By chief_abound in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-19-2015, 05:12 AM
  3. Replies: 13
    Last Post: 08-28-2014, 08:00 PM
  4. Replies: 1
    Last Post: 07-17-2014, 04:54 AM
  5. [SOLVED] extract data from within brackets
    By L.LEE in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-16-2014, 11:36 PM
  6. [SOLVED] How to extract data from brackets, [xx] and amend them?
    By eldarchen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2014, 09:56 AM
  7. How to extract a string within brackets repeatedly
    By wussupbuddy in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-11-2008, 10:38 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