LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Autofit/wraptext on vbLf problem


Hello,
I have a little formatting issue I am hoping one of you can help me with. I
have a vbs script that is creating and populating a spreadsheet that will
then be used to select some options and loaded into an API. One of the cells
is a list that needs to appear as a list with each list item on it's own line
within the cell.

I use this code to populate the cell:

'create vblf delimited list
strCyclist = Replace(WScript.Arguments.Item(6),",",vbLf)
'put it in the cell
objSheet.Cells(intDBRow,9) = strCyclist

I use this code to format:
With objSheet
.Columns("A:I").autofit
.Columns("B:B").Columnwidth = 45
.Columns("A:J").wraptext = True
End With
For Each intRow In objsheet.usedrange
intRow.EntireRow.AutoFit
Next


With my master plan here being that the autofit/wraptext would wrap that
cell on the vbLf. But it turns out that the autofit/autowrap is wrapping on
the first space in the text.

My idea kinda works in that if you enlarge the column width larger than a
single item in the list, then it wraps at the vbLf. So, I guess the wraptext
is working as expected but the autofit is sizing the column off the first
available space.

Any Ideas on how to get this to work as desired are welcome. Thanks in
advance.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA inserting chr(10) or vbLf Jack Sons Excel Discussion (Misc queries) 5 May 10th 10 04:53 PM
autofit problem Gary Keramidas Excel Programming 10 April 27th 06 12:10 PM
Range WrapText and AutoFit with Bold Peter Gummer Excel Programming 4 February 28th 06 03:37 AM
vblf and vbcr one last question terrysoper1973[_2_] Excel Programming 2 January 5th 06 10:49 PM
autofit row problem joeeng Excel Discussion (Misc queries) 1 July 25th 05 06:10 PM


All times are GMT +1. The time now is 09:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"