in reply to Excel Width Calculation

Excel calculates its cell width in points (1/72 of an inch). Given the width of each character in a font face for a given font size. Take your lengthiest string (which may not neccessarily need the most room (but should on most occassions) and then calculate how many points are needed to hold that string by

#assuming char width values in inches my %char_width(a=>1, b=>1.5); #etc.etc. #pseudo-code my $cell_width; while(length($string) != 0) { my $char = ($string =~ s/^(.{1})//); $cell_width += $char_width{$char}; }; $cell_width /= 72;
The length of the string has nothing to do with the calculation unless you are using a fixed width font face. In which case you can multiply the number of letters in the string by the width of a character in that font face for that font size
my $cell_width = length($string) * $char_width;

Also, just a question..When you say auto-sized cells, I assume you mean at point of initial template creation. To my knowledge there is no means to keep a cell auto-sized as the data in it changes.


Grygonos