Thread
:
Problems adjusting column width
View Single Post
#
4
Posted to microsoft.public.excel.programming
sean_mufc[_2_]
external usenet poster
Posts: 2
Problems adjusting column width
I did, could not find any help there either
"Don Guillett" wrote:
Look in the vba help index for AUTOFIT
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"sean_mufc" wrote in message
...
Hello all,
Just a quick question does anyone know of a way to programmatically adjust
the column with to ensure that the text within a cell is entirely visible.
I have tried
xlSheet.Columns.ShrinkToFit = true;
but this doesnt seem to work.
I have also tried doing it column by column using a range and a foreach
loop
but this has the same result.
foreach (string str in arrCols)
{
xlRange1 = xlSheet.get_Range(str + 1, str + 73);
xlRange1.Columns.ShrinkToFit = true;
}
Ive also tried AutoFit() but again not what I need. This just widens all
the
col widths to a standard area thats too large for what I need. I just need
the col width to be wide enough to show all the text and thats it, nothing
longer
Any suggestions??
Cheers,
Sean
Reply With Quote
sean_mufc[_2_]
View Public Profile
Find all posts by sean_mufc[_2_]