Setting Font and size for a table cell

J

jerry chapman

I have a VBA macro which creates a word table. I would like to select
certain cells in that table and specify the font & size for that text. How
can I do that?
 
J

Jezebel

You select cells using something like

Table.Cell(Row,Column).Range.Select

You can set the format using the cell range's Font object

with Table.Cell(Row,Column).Range.Font
.Size = ...
:
end with

Or you can refer to the individual paragraphs within the cell

Table.Cell(Row,Column).Range.Paragraphs(1) ...


It gets a little trickier if the table is not uniform (ie has split or
merged cells): Cell(Row, Column) might not exist for all rows and columns
withing the table.
 

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

Top