ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Setting up and Configuration of Excel (https://www.excelbanter.com/setting-up-configuration-excel/)
-   -   cell margins (https://www.excelbanter.com/setting-up-configuration-excel/5070-re-cell-margins.html)

rasty_9

cell margins
 
I don't think any of the respondents answered Katrina's question, and I have
the same question. Maybe if I restate it.
In MS Word tables, you can set a white space margin within the cell, on each
border of the text (i.e., left, right, top, bottom) to improve readability.
If the text wraps to a new line, these margins are maintained. I do not see
any parallel capability to do that in Excel. If you manually set the height,
then wrapped text will be partially hidden. Am I right or wrong?

"katrina" wrote:

I know I can indent text in a cell from the left and from
the right of the cell, but can anybody please tell me how
to indent it from the top and bottom? I want to be able
to autofit my rows to my text but leaving a gap at the
top and bottom so it's not all squashed. I know I can
make the rows bigger and then centre the text vertically,
but this is for a very big document so I don't want to
have to manually size each row.


Gord Dibben

Try this macro to indent left and add a blank line top and bottom then wrap
text and autofit.

Note: won't work with "merged" cells.

Sub Indent_Text()
Dim Cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo endit
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
moretext = Chr(10)
For Each Cell In thisrng
With Cell
.Value = moretext & Cell.Value & moretext
.Rows.AutoFit
.IndentLevel = 2
End With
Next
Exit Sub
endit:
MsgBox "only formulas in range"
End Sub


Gord Dibben Excel MVP

On Mon, 10 Jan 2005 07:53:03 -0800, "rasty_9"
wrote:

I don't think any of the respondents answered Katrina's question, and I have
the same question. Maybe if I restate it.
In MS Word tables, you can set a white space margin within the cell, on each
border of the text (i.e., left, right, top, bottom) to improve readability.
If the text wraps to a new line, these margins are maintained. I do not see
any parallel capability to do that in Excel. If you manually set the height,
then wrapped text will be partially hidden. Am I right or wrong?

"katrina" wrote:

I know I can indent text in a cell from the left and from
the right of the cell, but can anybody please tell me how
to indent it from the top and bottom? I want to be able
to autofit my rows to my text but leaving a gap at the
top and bottom so it's not all squashed. I know I can
make the rows bigger and then centre the text vertically,
but this is for a very big document so I don't want to
have to manually size each row.




All times are GMT +1. The time now is 11:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com