Hi Everybody,

I need to redo cell sizes – the width and the height in inches
While searching, I came across the a macro at http://processtrends.com/pg_charts_cell_size.htm

As per this line of code, it seems cell width can be set only in number of characters the cell can accommodate.
Columns(what_col).ColumnWidth = wide_char

OK. So, with Application.DefaultWebOptions.PixelsPerInch, it is possible to convert the reqd cell width in inches to pix and use the formula
Say,
ColumnWidthInPix = ColumnWidthInInches * Application.DefaultWebOptions.PixelsPerInch

And then define cell width in characters with
wide_char = (wide_pix - 5) / 5.

Now the question is
1. Why this “-5” and the division by 5 while converting from pix to character ? Pixel sizes vary. So why this constant “-5” and division by 5 ?
2. There seems to some connection with the width of standard font and cell sizes. If so what? How is it possible to find the width of the standard font via VBA ?
3. Or is there a way to define cell width in inches directly ?

Thanks in advance,

Geetha