+ Reply to Thread
Results 1 to 9 of 9

Extracting A Specific line from Multiline Excel Cells

  1. #1
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Extracting A Specific line from Multiline Excel Cells

    Hi Everyone,
    I have column A in excel where each cell contains "multiline text". Now I want to extract a specific line which contains the word "Phone". How can I do that?

    Many Thanks in advance.

    Best Regards,

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Extracting A Specific line from Multiline Excel Cells

    Please provide some sample data in a workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting A Specific line from Multiline Excel Cells

    Quote Originally Posted by AliGW View Post
    Please provide some sample data in a workbook.
    I have attached the sample data in excel workbook in attachment.
    Attached Files Attached Files

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Extracting A Specific line from Multiline Excel Cells

    Try this copied down:

    =TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("Phone:",A1),99),CHAR(10),REPT(" ",99)),99))

  5. #5
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting A Specific line from Multiline Excel Cells

    Quote Originally Posted by AliGW View Post
    Try this copied down:

    =TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("Phone:",A1),99),CHAR(10),REPT(" ",99)),99))
    I found small issue with this formula now: When I try to extract that line which contains "Box" then the formula does not perform correctly and displays the partial result. Please test it at your end.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Extracting A Specific line from Multiline Excel Cells

    Thanks for the rep!

    Sorry - I have just closed down my laptop for the evening.

  7. #7
    Forum Contributor
    Join Date
    07-19-2017
    Location
    usa
    MS-Off Ver
    2016 Professional Plus
    Posts
    128

    Re: Extracting A Specific line from Multiline Excel Cells

    No Problem.Take it easy. When you are online then please help me about this problem. Have great day

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Extracting A Specific line from Multiline Excel Cells

    I imagine someone else will finish this off for you - someone on your side of the pond.

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,978

    Re: Extracting A Specific line from Multiline Excel Cells

    Tiny tweak needed - remove the colon from the search text:

    =TRIM(LEFT(SUBSTITUTE(MID(A1,FIND("Phone",A1),99),CHAR(10),REPT(" ",99)),99))

    This will not work on any text where the word 'Phone' does not exist as an identifier.

+ 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. Replies: 3
    Last Post: 03-12-2017, 03:39 PM
  2. Extracting only the text from cells which are formatted in a specific way. (excel)
    By Mikee S in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-30-2016, 06:25 PM
  3. Get value of column from each line in multiline listbox
    By pclaesen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-24-2015, 10:20 PM
  4. [SOLVED] Excel Single Line vs Multiline records
    By oskar44 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-29-2015, 08:30 AM
  5. [SOLVED] MultiLine Textbox to auto remove blank line, count line, remove duplicate
    By khhoa in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-24-2015, 09:28 PM
  6. Help with Multiline textbox and removing a line from it
    By yoursamrit2000 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-09-2015, 12:57 AM
  7. Pass value and add line to multiline textbox
    By fredpox in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-18-2010, 06:02 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