View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming,alt.html
_rg_rg_ _rg_rg_ is offline
external usenet poster
 
Posts: 2
Default Help: HTML Table not displaying full text

All i have already experienced with exporting html from office give in the

best case aproximate results. In worth cases, html page is unreadable. I

didn't find any built in solution. So i wrote a macro code like the

following.

This will give you a nice dressed and well aligned web page with ALL text in

it. You can safely change all parameters.

For example, if you want to see Excel grid, change border=0 to border=1,

etc...





public sub PublieHtml()

Dim HTML As Integer

Dim i as Long, j as Long

HTML = FreeFile

Open ActiveSheet.Name & ".html" For Output As HTML

Print #HTML, "<html"

Print #HTML, "<head"

Print #HTML, " <title";ActiveSheet.Name;"</title"

Print #HTML, "</head"

Print #HTML, "<body"

Print #HTML, " <P<TABLE cellSpacing=1 cellPadding=1 border=0"

For j=1 to UsedRange.Rows.Count

Print #HTML, " <TR"

For i=1 to UsedRange.Columns.count

print #HTML, " <TD" ; Cells(j,i).Text ; "</TD"

Next i

Print #HTML, " </TR"

Next j

Print #HTML, " </TABLE</P"

Print #HTML, "</body"

Print #HTML, "</html"

Close #HTML

End Sub

"Leif K-Brooks" a écrit dans le message de
...
Jedi wrote:

When I export from Excel to static HTML


That's your problem.