+ Reply to Thread
Results 1 to 9 of 9

Replace the line with certain format

  1. #1
    Registered User
    Join Date
    04-14-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    33

    Replace the line with certain format

    Hi Excel experts

    Not sure if this is possible, but I want to remove certain line of text based on a format.
    For example, in the cells, it contains info like the following, they all start with <img alt= and end with /> but inside they have different content, i want to remove the entire line. Is that something possible? Please find the attachment

    <img alt='CCC' src='http://aaaa.com/14/11111.jpg' style='width:777px;' />
    <img alt='' src='http://asdf.com/images/asdfasdfsad9.jpg' style='height: 670px; width: 690px;' />
    <img alt='CCC' src='http://a21a.com/14/117878.jpg' style='width:222px;' />
    <img alt='' src='http://asdf114578.com/images/as123dfsad19.jpg' style='height: 888px; width: 456px;' />"

    Thanks a lot.
    Attached Files Attached Files

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

    Re: Replace the line with certain format

    Try
    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...

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Replace the line with certain format

    Try the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-14-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    33

    Re: Replace the line with certain format

    Hi Olly & AB33

    Thanks a lot for the help. The solution works with the example I provided. It actaully doesn't work with my real worksheet, but it is due to my fault, I should have given you the real example because the real example is much more complex with many html tags. Please find the attached. Can you please provide a new solution? Many thanks.
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,700

    Re: Replace the line with certain format

    Unable to add code because of Sucuri

    Added as a text file attachment


    It looks like I totally misunderstood the requirements
    Attached Files Attached Files
    Last edited by jolivanes; 07-13-2016 at 12:53 AM.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Replace the line with certain format

    I don't like copying the code from someone else's post and submit as a solution without showing in the public as GURU.

    itlyi2
    Is this how you wanted?
    Please Login or Register  to view this content.

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

    Re: Replace the line with certain format

    Quote Originally Posted by itlyi2 View Post
    Hi Olly & AB33

    Thanks a lot for the help. The solution works with the example I provided. It actaully doesn't work with my real worksheet, but it is due to my fault, I should have given you the real example because the real example is much more complex with many html tags. Please find the attached. Can you please provide a new solution? Many thanks.
    My code works perfectly with that workbook attachment?

  8. #8
    Registered User
    Join Date
    04-14-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    33

    Re: Replace the line with certain format

    Hi jolivanes
    I am afraid you misunderstand my point here, and it doesn't work. but thank you very much for your help!

  9. #9
    Registered User
    Join Date
    04-14-2016
    Location
    london
    MS-Off Ver
    2013
    Posts
    33

    Re: Replace the line with certain format

    Hi jindon

    Thank you so much for your effort, it does work perfectly. Really appreciate!

+ 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. How To Replace One Line From Email Body With New Line
    By Upendra2016 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2016, 04:01 AM
  2. [SOLVED] Replace a line in a txt document using vba
    By john34 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-16-2015, 03:35 AM
  3. [SOLVED] how to convert single line data format to multiple line data format
    By pksreela in forum Excel General
    Replies: 3
    Last Post: 10-16-2012, 08:13 AM
  4. replace : with new line in VBA editor
    By pike in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-15-2011, 06:23 AM
  5. Find / Replace with new line
    By drew138 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-11-2009, 07:13 PM
  6. Replies: 1
    Last Post: 12-09-2005, 01:00 PM
  7. replace , with a new line
    By delphi in forum Excel General
    Replies: 4
    Last Post: 05-24-2005, 11:47 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