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!

MS Access or Excel Cells to HTML

Status
Not open for further replies.

blakrapter

Technical User
Oct 18, 2007
11
US
Hello everyone,

I have a large database of information for about 15,000 products. In the "description" field, I have sometimes lengthy descriptions with lists, paragraphs, etc. These descriptions are already formated the way I want them to appear, as far as line breaks. I need to convert them to html, even if its just adding the <div> </div> code to create a break when there is a line break in the data.

I have tried the find/replace command and for some reason it is very inconsistant. I am searching for and replacing the same thing each time, but I often get a message that it cannot find anything to replace (looking for alt010). Other times it works fine, but only on trial workbooks, not the sheet with all 15k products. All of this has been tried in excel, I have done little with Access. I have given up on excel, so I am turning to Access.

I am running office 2007 and get the error mentioned above. Prior to that, I was running Office 2003 and recieved an error "equation too long" in excel. I did not have Access 2003...

How can I search for the "alt010" or "chr(10)" (I think, whatever a linebreak symbol is) and replace it with something? I assume it will need to be a macro, but I know absolutely nothing about macros... Any help will be greatly appreciated.
 
I am not sure how much you know about html coding but

<div> is for a division

<br> is like a character return
<p></p> is for new paragraph

<pre></pre> is what is used for preformatted text.

Are you trying to save the spreadsheet as html?

Can you post a sample html of what you are getting and what you want to get?

ck1999
 
A starting point (VBA code):
newValue = Replace(oldValue, vbCrLf, "<BR>")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the info guys.

PHV, I know nothing about codeing, so unfortunately, your code is greek to me. I sort of understnad what it is doing, but I have no idea how to actually implement it.

The following is an example of the contents of a cell:

'Patented “butterfly” design features a no-slip, rubberized rest that holds guns firmly in place without damaging finishes.

- Same bag design used by Browning engineers to test and verify the accuracy of the B.O.S.S. System

- Enhances accuracy

- Reduces recoil

- Carry strap

- 15" bench model

- Comes unfilled to allow shooter to fill with choice of material such as sand, rice, millet, birdseed, etc.

- Large, oversized fill spouts

- Signature colors



I need to replace every line break with a division, break, or paragraph break (any will do to achieve the formatting I desire. I just need to be able to break the lists of features away from the paragraph description and need to make sure the lists have line breaks to keep them from running together.

I tried the pre tag and it sort of works. The problem is, it will not allow line breaks for table size adjustments. i.e. a long paragraph that would normally wrap to 4 or 5 lines runs out in one line, regardless of how wide the table grows...

Also, I do not want the entire spreadsheet to be in HTML, just one column of data, and each cell needs to be independent of the others, so the "save as html" does not work in this case.

Thanks again for all of your help!
 
I know nothing about codeing
So, why posting in a VBA forum ????
 
So you guys could point me in the right direction... That's what message boards or for....

Doesn't matter though, I figured it out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top