in reply to Problems setting Excel cell width
Which gives the result:... # find initial width of B4 $w1 = $sheet->Range("B4")->Width; my $cw1 = $sheet->Range("B4")->{ColumnWidth}; # find new width of B4 $w2 = $sheet->Range("B4")->Width; my $cw2 = $sheet->Range("B4")->{ColumnWidth}; # set column D to cell width found for cell F4 $sheet -> Range("D4") -> {ColumnWidth} = $w2; # find width of column D $w3 = $sheet->Range("D4")->Width; my $cw3 = $sheet->Range("D4")->{ColumnWidth}; # set column F to 60 $sheet -> Range("F4") -> {ColumnWidth} = 60; # find width of column F $w4 = $sheet->Range("F4")->Width; my $cw4 = $sheet->Range("F4")->{ColumnWidth}; print "B4 width 1<$w1> 2 <$w2> D4 width <$w3> F4 width <$w4>\n"; print "B4 colwidth 1<$cw1> 2 <$cw2> D4 colwidth <$cw3> F4 colwidth <$c +w4>\n";
B4 width 1<48> 2 <105> D4 width <555> F4 width <318.75> B4 colwidth 1<8.43> 2 <19.29> D4 colwidth <105> F4 colwidth <60>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Problems setting Excel cell width
by merrymonk (Hermit) on Jan 27, 2010 at 16:33 UTC | |
by hominid (Priest) on Jan 27, 2010 at 20:25 UTC |