Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel and HTML

Status
Not open for further replies.

blakrapter

Technical User
Oct 18, 2007
11
US
Hello everyone,

I am new here and found this forum when searching for an answer to this problem. I am looking for a way to conver individual cells in an excel spreadsheet to HTML. Here is the deal:

I have a large spreadsheet of products (about 11,000). This spreadsheet contains formated product descriptions that were copied and pasted (apparently) from a word processor. These descriptions have paragraphs, lists, line breaks, etc and showup that way in each cell. I need to upload them to a website, but for that to happen, the descriptions need html formatting tags (mainly the line break tags). If those tags are not there, the website displays the descriptions as one large paragraph with no line breaks. Is there a command or macro that will allow me to take a cell and convert it to the equivalent html formated text and put it in another cell (or replace the existing)? Due to the quantity, I cannot format them all individually. I have been unable to find any way to "find and replace" line breaks with code either.

Hopefully my question is clear, it is sort of difficult to explain.

Thanks!
 
="<B>"&A1&"<B>"

would be an example of having cell A1 turn into <B>cell A1<B>.

You can then copy and paste special the values of those formulas.

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
bluedragon,

Thank you for the suggestion, however, my problem is the linebreaks within the cell. Many of the cells contain multiple paragraphs and lists, therefore, they need html tags in various places in the cell (wherever there is a linebreak), not just at the begining and end. So, I need excel (or something) to go through and recognize these line breaks and add the proper coding, like dreamweaver or front page would do (just on a very simple level since line breaks are the only things I care about) Thanks!
 
What happens when you use the "Save as html" option in excel ?

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
It actually creates a webpage, but does not add html code to the cells. It does create html code, but not in a format I can copy and put back into my worksheet.

Thanks!
 
I don't know if this will help you, but I created a cell with several lines. (I hit Alt-Enter to get them in there.)

Then I did a replace (Alt-H).
In the Find what field I held down the Alt key and typed 010 on the number pad.
In the replace with field I entered </b>. (That may not be what you want, but it is what I used in my test.)
Then I clicked the Replace All button.

The line breakes where replaced by the </b> values.

Hope that helps.
Deb
 
That may work. I will give that a try. Thank you for the suggestion!
 
Dallen,

Good call. That almost worked. It will work on cells with a few lines, but it is telling me the formula is too long on the vast majority of the cells. I am using Office 2003. Is this a version limitation, or is the find/replace only good for cells with a limited number of characters?

Thanks!
 
I thought you were replacing in text entries, and not in formulae?

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Glann,

I am, but the error it gives me states "Formula is too long." If I create a cell with just a few lines, it works fine...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top