Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 279
Default wrap text inserts a padding blank line

I use Excel 2003 (11.5612.5606).

I thought I had a row autofit problem; I actually seem to have a wrap
text problem. I have a cell in which the text can fit in one line; when
wrap text is set, the cell is two lines deep.
I have seen many descriptions of this problem; I have seen neither
explanation nor solution.

To demonstrate the problem:
1) open a new workbook;
2) Either:
a) in A1, set the column width to 600 pixels, the font as Tahoma, Bold,
Italic and the text on one line to
12345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 2345678 7 2345678 8 2
At this point, the text is in one line and can all be seen.
Setting wrap text on the cell causes it to consist of a line of text and
a blank line.

or
b) run VBA code similar to this: (I recorded a macro and tweaked it.)
(You may hit a line wrap error ;)
Columns("A:A").ColumnWidth = 74.38 ' 600 pixels
Range("A1").Select
With Selection
' Let's have Tahoma, Bold, Italic
With .Font
.name = "Tahoma"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Bold = True
.Italic = True
End With
' Fill the cell on one line
ActiveCell.FormulaR1C1 = _
"12345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 2345678 7 2345678 8 2"
' WrapText causes the cell to consist of text and a blank line
.HorizontalAlignment = xlGeneral
' .VerticalAlignment = xlBottom
.VerticalAlignment = xlJustify
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

If I remove a couple of characters from the line and put them back
again, the blank line disappears.

I would value an explanation of Excel's behavior (sic).

I would also value any constructive criticism of the way in which I have
presented the problem to allow anyone interested to repeat my
observations.
--
Walter Briscoe
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 129
Default wrap text inserts a padding blank line

Hi Walter,

I copied your example and can see what you mean.

Not sure why it does it but when you format the cell to wrap if you change
the horizontal text alignment to Fill, then you dont get the blank line above.

Hope this helps

"Walter Briscoe" wrote:

I use Excel 2003 (11.5612.5606).

I thought I had a row autofit problem; I actually seem to have a wrap
text problem. I have a cell in which the text can fit in one line; when
wrap text is set, the cell is two lines deep.
I have seen many descriptions of this problem; I have seen neither
explanation nor solution.

To demonstrate the problem:
1) open a new workbook;
2) Either:
a) in A1, set the column width to 600 pixels, the font as Tahoma, Bold,
Italic and the text on one line to
12345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 2345678 7 2345678 8 2
At this point, the text is in one line and can all be seen.
Setting wrap text on the cell causes it to consist of a line of text and
a blank line.

or
b) run VBA code similar to this: (I recorded a macro and tweaked it.)
(You may hit a line wrap error ;)
Columns("A:A").ColumnWidth = 74.38 ' 600 pixels
Range("A1").Select
With Selection
' Let's have Tahoma, Bold, Italic
With .Font
.name = "Tahoma"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.Bold = True
.Italic = True
End With
' Fill the cell on one line
ActiveCell.FormulaR1C1 = _
"12345678 1 2345678 2 2345678 3 2345678 4 2345678 5 2345678 6 2345678 7 2345678 8 2"
' WrapText causes the cell to consist of text and a blank line
.HorizontalAlignment = xlGeneral
' .VerticalAlignment = xlBottom
.VerticalAlignment = xlJustify
.WrapText = True
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With

If I remove a couple of characters from the line and put them back
again, the blank line disappears.

I would value an explanation of Excel's behavior (sic).

I would also value any constructive criticism of the way in which I have
presented the problem to allow anyone interested to repeat my
observations.
--
Walter Briscoe

Reply
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
I want to line up wrap around text within cell by tabbing over? stuck in PA Excel Worksheet Functions 3 November 14th 08 08:22 PM
Wrap text creates an extra line Arun Excel Discussion (Misc queries) 7 September 25th 08 01:28 AM
Cell set to wrap text and blank line -- fix? Fred Holmes Excel Discussion (Misc queries) 0 January 25th 05 07:10 PM
how can I wrap text from one line to another? gabalex Excel Worksheet Functions 5 December 17th 04 03:13 PM


All times are GMT +1. The time now is 03:24 PM.

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

About Us

"It's about Microsoft Excel"