Excel Formatting Cells Using VB code

  • Thread starter Thread starter Andrew Price
  • Start date Start date
A

Andrew Price

Am fairly new to excel programming,

I am passing in a HTML file to Excel using Style guidelines.

<style>
<!--table
@page
{mso-header-data:"&CMultiplication Table\000ADate\: &D\000APage &P";
mso-page-orientation:landscape;}
br
{mso-data-placement:same-cell; mso-word-wrap:true;}
-->
</style>

Does anyone know the syntax or even if it possible to globally set the cells
so that the format is

FormatCells.Alignment.TextAlignment.vertical = top
FormatCells.Alignment.TextControl.wordwrap = true

set in the HTML style tags as above.

Thanks in advance

Andrew
 
I just recorded a macro and go the following:
Cells.Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlTop
.WrapText = True
.Orientation = 0
.ShrinkToFit = False
.MergeCells = False
End With
If that's what your asking, hope this helps since I'm not sure about the
HTML part...
 
Thanks tim,

Good start and cool having the correct syntax, does anyone know if this
routine can be run from the <head> section to format the cells, have tried
playing, adding to the HEAD tag and after the body tag to no avail ?

can anyone help?

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top