Formatting text in cells with html tags

zesthealth

New Member
Joined
Jan 9, 2019
Messages
2
hello , im hoping i can get some advice on a problem i have.

I need to be able to add a simple <p> tag to specific points in my text in excel cells. so for example some of my cells have product descriptions liek this

Goodio Raw Chocolate 56% Coffee 48g x 15
Starring sweet, smooth and powerful Espresso Verde organic coffee beans with cashew nuts for creamy taste.

the problem i have is that excel just sees that as one long string i.e

Goodio Raw Chocolate 56% Coffee 48g x 15Starring sweet, smooth and powerful Espresso Verde organic coffee beans with cashew nuts for creamy taste.

so what i need to do is add a <p> tag to the end of the 1st line so it woudl be soemthign like this in the cell

Goodio Raw Chocolate 56% Coffee 48g x 15<p>
Starring sweet, smooth and powerful Espresso Verde organic coffee beans with cashew nuts for creamy taste.




however , i cant do a find and replace as the text differs in each cell so was wodnering if there is a way to add the tag to a line break as in the exampel below.

hwo do i attach sample data in excel so that you can see what i mean ?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi
Welcome to the board

Not clear.

I'll take a guess



I understand you have in a cell

1st line
2nd line
3rd line

and you'd like to add paragraph tags to post it in html, so that you have instead

<p>1st line</p><p>2nd line</p><p>3rd line</p>

If this is what you want you can use

="<p>"&SUBSTITUTE(A1,CHAR(10),"</p><p>")&"</p>"

is this what you want?
 
Upvote 0

Forum statistics

Threads
1,223,901
Messages
6,175,277
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top