PDA

View Full Version : Get rid of extra row height with Word Wrap



NarR
04-25-2017, 04:24 AM
Hello,
is there a way to get rid of the extra row height when the first line in the cell is full and Word Wrap activated?
See the Screenshot in the Attachment for better understanding. Here the Problem is the first line.
If more lines in the cell have the same problem, then you get 1 extra line for each, i.e. in the second picture 3 extra lines.
19012 19013
- activated Word Wrap
- activated Auto-fit
- no blank spaces after the last "l"
- Calibri 11
- Column width 10,86

If i adjust the columns width then the Auto-fit works properly.
But if you have enough rows you will never get a columns width that fits for all rows.

I searched many times in the web and this forum, but can only find people complaining without solution.
Can i solve the problem with a macro or a basic excel configuration?

thank you for your help

mdmackillop
04-25-2017, 05:05 AM
Excel is not very clever at text spacing, resulting in the unpopulated space. You could try a non-proportional font eg. Courier or as I do, align the text to the top of the cell and live with the space at the bottom.

Paul_Hossler
04-25-2017, 05:45 AM
The closest I've ever gotten is using something like this


Before

19014


After

19015





Option Explicit
Sub Macro2()

Columns("B:C").ColumnWidth = 200
Rows("1:3").EntireRow.AutoFit
Columns("B:C").EntireColumn.AutoFit
Columns("B:C").VerticalAlignment = xlTop
End Sub

NarR
04-26-2017, 05:04 AM
mdmackillop: i use normally "top" alignment, here just posted this way because it is the default. Font Courier would solve the Problem because each letter has the same width, but is not nice to show in meetings.
paul: i tryied the macro but in my case i dont get any reaction to Rows(...).EntireRow.AutoFit. With Columns(...).EntireColumn.AutoFit i get "first line" and in the next line "full", some reaction to dobleclick on the right border of the column name.
Does your cell show the empty lines after editing and just press enter?