locked
Column Width - how many characters possible? RRS feed

  • Question

  • As far as I know the unit of column width in Excel are determined in characters. For Excel 2003 (German Version) the default value is 10,71 (with default font: Arial 10).

    I filled a Cell with 10 characters to check this measurement, but there was even more space left. So I could write about 12 characters to fill the cell without exceeding the limit!

    Is this measurment right?

    Wednesday, July 28, 2010 9:07 AM

Answers

  • Measurement of length of letters is not always linear. The font Arial will have different length for the letters 'i' or 'M'. For this reason, you could not count letters to estimate the length in pixels.

    Possibility one: Use Courier instead of Arial. The Courier-font is linear

    Possibility two: use something like Graphics.MeasureString (C-Sharp) to estimate the size in pixels.

    • Marked as answer by CodeResearcher Wednesday, July 28, 2010 12:01 PM
    Wednesday, July 28, 2010 11:21 AM

All replies

  • Measurement of length of letters is not always linear. The font Arial will have different length for the letters 'i' or 'M'. For this reason, you could not count letters to estimate the length in pixels.

    Possibility one: Use Courier instead of Arial. The Courier-font is linear

    Possibility two: use something like Graphics.MeasureString (C-Sharp) to estimate the size in pixels.

    • Marked as answer by CodeResearcher Wednesday, July 28, 2010 12:01 PM
    Wednesday, July 28, 2010 11:21 AM
  • I'm surprised you say your default width with Arial 10 is 10.71, I would expect 8.43 though it can vary by very small amounts in earlier versions.

    As you say the column width is measured in units of characters, specifically those of the Fort as defined in the 'Normal' style. Obviously the width of Proportional font characters can vary though numerals and some other characters are fixed.

    It is possible to change the 'StandardWidth' but by default the column width is 8 characters plus some cell padding.

    Start a new workbook and enter 12345678

    Regards,
    Peter Thornton

    Wednesday, July 28, 2010 7:23 PM