PDA

View Full Version : how to change column width



Ashes.cfg
10-16-2007, 06:16 AM
Hi guys,
i need to change column width and it shud change according to the length of the string..the prob i am having right now is in the date column all i get is ####### instead of the actual date and i have to manually expand the column to check the date out..i recorded the macro and increased the width.but i dont want it that way..the reason being i am coding in perl.so please help me with this in vba and i will try convert it into perl(well u cud help me in perl also hehe)
thanks!

lucas
10-16-2007, 06:19 AM
Try this:
Columns("E:E").Columns.AutoFit

Ashes.cfg
10-16-2007, 06:53 AM
I am still getting ######
well this is the code in perl for wat u said
$workbook->ActiveSheet->Columns->AutoFit();

but still i am getting ###### instead of the date needed!

Norie
10-16-2007, 07:15 AM
Are there valid dates in the column?

Ashes.cfg
10-16-2007, 07:26 AM
yups..see the prob is the dates 10/9/2007 is appearing just fine... but the dates like 10/14/2007 they appear as ######### and its not tht they are corrupted or something.if i increase the columnwidth i am able to see the correct date. i recorded a macro to increase this width but i dont want it that way. wud like a permanent solution..plus i am coding in perl..its like i finished the whole project in 4 days and am stuck on this silly thing for like 2 days trying to increase column width..feels stupid!!!!