• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Wrapping text with line breaks without merging

rlburden

New Member
In earlier version of Excel I could have data within a cell which had line breaks to force it over say 4 lines. I could then allow the data to extend beyond the right hand boundary of thel cell without wrapping, but still breaking the data at the line breaks. In Excel 2010 it insits on fitting the data withion the current cell and NOT extending across into the next cell. The only way to get the look I want is to merge the two cells - and merging makes subsequnet control of the spreadheet more difficult.


Can anyone help


To be specific


I want data such as


Firstline is quite long <line break>

2nd line is short


to extend over he edge of the cell (say after the word short) rather than


Firstline is quit

e long <lb> 2nd i

s short
 
Hi, rlburden!


I don't know if I understood correctly. Let's see.


I tiped your example:

[pre]
Code:
First line is quite long <line break>
2nd line is short
[/pre]
in A1 cell of a clean sheet using Alt-Enter as line break. Excel put all together in the same cell and changed the alignment to wrap text ("ajustar texto" in spanish). If I changed it to not wrapping text, I got "First line is quite long2nd line is short" in the cell and over B1 and so on, but in the edit line I got "First line is quite long <line break> 2nd line is short". I set it again to on, changed the column width to wider and the row height to greater, and I saw the data ok.


But I insist, I don't know if this is what you intended to ask. If not, please upload a sample file.


Regards!
 
Hi, rlburden


You can enter text and press alt where you want to break the line. Or if you are looking to apply this format repetitively guess some VBA is required, something like:


Sub ShowText2Lines()

Dim Text2Show As String

Dim Text1stLine As String

Dim Text2ndLine As String

Text1stLine = "First line is quite long "

Text2ndLine = "2nd line is short"

Text2Show = Text1stLine & vbLf & Text2ndLine

ActiveCell.ColumnWidth = 20

ActiveCell.Value = Text2Show

End Sub


You could load the 1st line and 2nd lines from within VBA or change the code to read in Cell contents holding the 2 strings.

Cheers
 
Back
Top