ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting width in pixel in Excel (https://www.excelbanter.com/excel-programming/406628-setting-width-pixel-excel.html)

Sonnich Jensen[_2_]

Setting width in pixel in Excel
 
Hi all

I am trying to set the width of coloumns to 16 pixels. I know I cannot
set that directly, so in stead I try to set the columnwidth, and
adjust it by reading the width.
Result: A is alway 0 - hidden :-) and the following C E etc are 22
pixels, 1.57 chars.

What do I do wrong?

WBR
Sonnich

for($j=0;$j<$h;$j++)
{
$WB-Sheets(1)-Columns($j*2+1)-ColumnWidth=1;
while($WB-Sheets(1)-Columns($j*2+1)-Width < 16)
$WB-Sheets(1)-Columns($j*2+1)-ColumnWidth =
$WB-Sheets(1)-Columns($j*2+1)-ColumnWidth + 0.1;


All times are GMT +1. The time now is 01:53 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com