+ Reply to Thread
Results 1 to 12 of 12

Please help with a =SUBSTITUTE formula with html code in the cell

  1. #1
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Please help with a =SUBSTITUTE formula with html code in the cell

    I have this html code in column B in my spreadsheet. I am trying to replace each instance of the words 'Acorn Chain Dog Collar in Berry' with whatever text is in column A, for each row. Column A is different for every row, Column B is the same for each row.

    Example:

    Column A1 - Hourglass Dog Collar Poppy


    Column A2 - <h1>Acorn Chain Dog Collar in Berry<br></h1><div>The <span style="font-weight: bold;"><span style="font-style: italic;">Acorn Chain Dog Collar in Berry</span></span> by Bow Wow Couture. This chic dog collar is more than just another pretty face! A unique, all cotton pet collar designed and constructed using top quality hardware, heavyweight interfacing and durable, 100% machine washable designer fabrics. Bow Wow Couture only uses curved side release buckles designed to hug your dog's neck. Thick, nickel plated D rings.&nbsp;The <span style="font-weight: bold; font-style: italic;">Acorn Chain Dog Collar in Berry</span> is made is super soft, gorgeous, durable, made in the USA and will look perfect on your pet!&nbsp;Add a matching Bow Wow Couture dog collar flower, bow tie and/or matching leash, to complete the look of the <span style="font-style: italic;"><span style="font-weight: bold;">Acorn Chain Dog Collar in Berry.</span></span></div>


    Want to automatically replace "Acorn Chain Dog Collar in Berry" in B1 (and so on) with "A1" (and so on)", everwhere "Acorn Chain Dog Collar in Berry" appears. I have so many different rows of content like this that it would take way to long to do a manual search and replace for each, looking for a faster way. I have tried everything, any help would be greatly appreciated.

    Thanks!!!
    Last edited by rcheltrvel; 05-11-2013 at 04:30 PM. Reason: Moderators wanted me to change the title

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Please help with a formula for this...

    Welcome to the forum. Please note that you may be asked by the moderators to change your thread title to comply with forum rules. In the meantime, try:

    =SUBSTITUTE($A2,"Acorn Chain Dog Collar in Berry",$A$1)


    And drag down.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,093

    Re: Please help with a formula for this...

    Actually, re-reading the question suggests that you could use Replace All rather than just a manual search and replace.


    Regards, TMS

  4. #4
    Forum Contributor
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2010
    Posts
    272

    Re: Please help with a formula for this...

    Hi,

    Suppose cell A1 is "Acorn Chain Dog Collar in Berry" in B1 HTML coding, & in C1 following function & simply drag

    =SUBSTITUTE(B1,SUBSTITUTE(LEFT(B1,FIND("<br>",B1,1)-1),"<h1>",""),A1)
    Please consider adding a * if I helped

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Please help with a formula for this...

    HI rcheltrvel,

    welcome to the forum.
    Suggest you to change the thread title to reflect the query you are asking, see forum rules:-
    http://www.excelforum.com/forum-rule...rum-rules.html

    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  6. #6
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Please help with a formula for this...

    Quote Originally Posted by wfm007 View Post
    Hi,

    Suppose cell A1 is "Acorn Chain Dog Collar in Berry" in B1 HTML coding, & in C1 following function & simply drag

    =SUBSTITUTE(B1,SUBSTITUTE(LEFT(B1,FIND("<br>",B1,1)-1),"<h1>",""),A1)

    THANK YOU, THANK YOU!!! @wfm007

    Complicated but totally worked, I have been trying to do that for years. I know nothing about spreadsheets and just wing it.

  7. #7
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Please help with a formula for this...

    Quote Originally Posted by rcheltrvel View Post
    THANK YOU, THANK YOU!!! @wfm007

    Complicated but totally worked, I have been trying to do that for years. I know nothing about spreadsheets and just wing it.
    Hi, could you tell me how to do the exact same thing but with this code instead? Maybe from this I can figure out how to modify the formula for each instance of this...

    [<META NAME="DESCRIPTION" CONTENT="Beautiful & colorful, cotton pet collars with options in berry dots.The Acorn Chain Dog Collar in Berry by Bow Wow Couture at the Doggie Diva dog boutique online. Designer dog collars at affordable prices. Add a matching leash, flower and/or bow tie. Great for boys as well!!!"> <META NAME="ABSTRACT" CONTENT="Acorn Chain Dog Collar Berry at the Doggie Diva dog boutique online."> <META NAME="KEYWORDS" CONTENT="leashes, bow wow couture, berry, acorn, chain, cotton, dog collars, pet collar, collar, bow wow, bow tie, flowers">]

    Wherever it says the words 'Acorn Chain Dog Collar in Berry' in A2, I want it to replace with whatever I have in A1.

  8. #8
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Please help with a formula for this...

    Quote Originally Posted by rcheltrvel View Post
    Hi, could you tell me how to do the exact same thing but with this code instead? Maybe from this I can figure out how to modify the formula for each instance of this...

    [<META NAME="DESCRIPTION" CONTENT="Beautiful & colorful, cotton pet collars with options in berry dots.The Acorn Chain Dog Collar in Berry by Bow Wow Couture at the Doggie Diva dog boutique online. Designer dog collars at affordable prices. Add a matching leash, flower and/or bow tie. Great for boys as well!!!"> <META NAME="ABSTRACT" CONTENT="Acorn Chain Dog Collar Berry at the Doggie Diva dog boutique online."> <META NAME="KEYWORDS" CONTENT="leashes, bow wow couture, berry, acorn, chain, cotton, dog collars, pet collar, collar, bow wow, bow tie, flowers">]

    Wherever it says the words 'Acorn Chain Dog Collar in Berry' in A2, I want it to replace with whatever I have in A1.
    Is the code the reason I am having such a hard time with this? I tried so many things to get this to work before your help and just couldn't get anything to work when the html tags were in there.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Please help with a formula for this...

    Hi and welcome to the forum

    We would love to help you with your question, but 1st, in accordance with forum rule, please rename your thread to something more meaningful, that actually describes your problem.

    Because thread titles are used in searching the forum it is vital they be written to accurately describe your thread content or overall objective using ONLY search friendly key words. That is, your title used as search terms would return relevant results.

    Also, many members will look at a thread title, and if it is of interest to them, or it falls within their area of expertese, they might only open those threads.

    Look at it this way...if you typed that title into google, what would you expect to get back?
    To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Please help with a formula for this...

    Quote Originally Posted by FDibbins View Post
    Hi and welcome to the forum

    We would love to help you with your question, but 1st, in accordance with forum rule, please rename your thread to something more meaningful, that actually describes your problem.

    Because thread titles are used in searching the forum it is vital they be written to accurately describe your thread content or overall objective using ONLY search friendly key words. That is, your title used as search terms would return relevant results.

    Also, many members will look at a thread title, and if it is of interest to them, or it falls within their area of expertese, they might only open those threads.

    Look at it this way...if you typed that title into google, what would you expect to get back?
    To change a Title on your post, click EDIT on you're 1st post, then Go Advanced and change your title
    I am new here and not exactly sure what you guys want me to rename my title? I barely know how to ask what I am trying to ask, let alone shorten it to one sentence. I got the answer I needed, did I do something wrong?

  11. #11
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,917

    Re: Please help with a =SUBSTITUTE formula with html code in the cell

    what you changed it to was fine, thanks As I said, members often use the search facility to find answers, so we insist that thread titles are constructed to make that easier...
    Look at it this way...if you typed "Please help with a formula for this..." into google, what would you expect to get back?

  12. #12
    Registered User
    Join Date
    05-11-2013
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: Please help with a =SUBSTITUTE formula with html code in the cell

    o

    Now I changed my title and no more answers to my question.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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