View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Columnwidth change not correct

The following is copied from Help in xl2007. It might help explain the unit
of measurement which is used.

On a worksheet, you can specify a column width of 0 (zero) to 255. This
value represents the number of characters that can be displayed in a cell
that is formatted with the standard font (standard font: The default text
font for worksheets. The standard font determines the default font for the
Normal cell style.). The default column width is 8.43 characters. If the
column width is set to 0, the column is hidden.

Regards,

OssieMac

"Mike" wrote:

Excel 2003

When I run the program below, the debug shows: 50.58 and 50.57

I then physically measure the 6 columns and get 9.5 centimeters

and then measure column 10 and get 8.5 centimeters.

Does anybody know what's going on here?

-------------------------------------------------------------------------

sub doit

Dim widthOfSixColumns As Single

Dim columnTenWidth As Single

widthOfSixColumns = Sheets("sheet1").Columns(1).ColumnWidth * 6

Sheets("sheet1").Columns(10).ColumnWidth =
Sheets("sheet1").Columns(1).ColumnWidth * 6

columnTenWidth = Sheets("sheet1").Columns(10).ColumnWidth


end sub



Thanks