ammox2000
asked on
VB to Excel Autofit Problem
Hi
Take a look at following statement:
strTempAddr = strTempAddr & Trim(objAddr.Fields("Bldg_ Name")) & " " _
& Trim(objAddr.Fields("Area" )) & " " & Trim(objAddr.Fields("Landm ark")) _
& vbNewLine & Trim(objAddr.Fields("City" )) & " " & Trim(objAddr.Fields("Distr ict")) _
& vbNewLine & Trim(objAddr.Fields("State "))
Then I add this string in an Excel sheet and then do autofit :
objSheet.Columns.AutoFit
But, for some reason, it just does not autofit.
Autofit works fine as long as text is in single line, but multiline text as given above spoils all the autofit.
I tried turning word wrap on/off, but no use.
Is there any way to format multiline text in a single cell ?
Thanks and Regards,
Amol.
Take a look at following statement:
strTempAddr = strTempAddr & Trim(objAddr.Fields("Bldg_
& Trim(objAddr.Fields("Area"
& vbNewLine & Trim(objAddr.Fields("City"
& vbNewLine & Trim(objAddr.Fields("State
Then I add this string in an Excel sheet and then do autofit :
objSheet.Columns.AutoFit
But, for some reason, it just does not autofit.
Autofit works fine as long as text is in single line, but multiline text as given above spoils all the autofit.
I tried turning word wrap on/off, but no use.
Is there any way to format multiline text in a single cell ?
Thanks and Regards,
Amol.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Amol.