Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CHR(10) line feed spacing

Status
Not open for further replies.

davefish

Technical User
Jul 26, 2002
169
GB
Using ALT-Enter in a cell I wish to reduce the line feed spacing but cannot find this via formatting. Is there anyway to apply an Alt-Enter with a variable line space via VBA?
 
hi,

I assume this is Excel, Version???


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If that's the case, you can 'change' the line spacing within a cell in Excel, by changing the FONT SIZE of the LINE FEED character.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Hi Skip,


I'm using Excel in office 2010, but the original file was created using 2003. My issue is that I wish to maintain a specific cell size (width 29 and height of 70) as well as a font size of 12 point, but reducing the spacing between the lines. I'm entering multiple lines but even if I reduce a font size the line spacing stays the same. I also have word wrap on! Does this help?

Regards

Dave
 
Turns out that what I was expecting to happen, did not.

I used this code, but the line spacing does not change as I expected???
Code:
    Dim i As Integer
    
    With ActiveCell
    
        Do
            i = InStr(i + 1, .Value, vbLf)
            If i > 0 Then
                With .Characters(i, 1)
                    .Font.Size = 6
                End With
            End If
        Loop Until i = 0
        
    End With
where the active cell contains
[tt]
now is the time
for all good men
to come to the aid
of their country
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
You don't have that level of control for text in a cell. Insert a Textbox shape if you neeed a higher level of text formatting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top