View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike[_113_] Mike[_113_] is offline
external usenet poster
 
Posts: 40
Default Columnwidth change not correct

My point is: it says that they are equal 50.58=50.57 but they are N O T
9.5 cm < 8.5 cm.



"OssieMac" wrote in message
...
I have had another look at your post. I'm not sure now that I was on the
same wave length as yourself. What exactly are you trying to do? Your code
simply sets the width of column 10 to 6 times wider than column 1. What is
it
about measuring 6 columns? The marginal difference in the 50.58 and 50.57
is
because it is not always possible to set the column width the exact
measurement. This even occurs when you manually set column widths; it
simply
goes to closest allowable.

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