ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   increase cell margins globally like word? (https://www.excelbanter.com/excel-discussion-misc-queries/145225-increase-cell-margins-globally-like-word.html)

Diane B

increase cell margins globally like word?
 
I have a file with different row heights; I don't want the rows to be all the
same height - I want them to fit to contents, but I want there to be some
padding between cells. In Word tables you can highlight the rows you want,
regardless of their individual height, and enter whatever cell margin you
want and it affects all selected rows. Is there a way to do this in Excel?
Thanks!

Gord Dibben

increase cell margins globally like word?
 
Horizontally you can pad using FormatCellsAlignmentIndent.....right or left.

Vertically is another matter.

This macro will add a carriage return to right side of any text in a cell which
will give you a vertical padding.

Sub Add_Text_Right()
Dim cell As Range
Dim moretext As String
Dim thisrng As Range
On Error GoTo justformulas
Set thisrng = Range(ActiveCell.Address & "," & Selection.Address) _
.SpecialCells(xlCellTypeConstants, xlTextValues)
moretext = Chr(10)
For Each cell In thisrng
cell.Value = cell.Value & moretext
Next
Exit Sub
justformulas:
MsgBox "only formulas in range"
End Sub


Gord Dibben MS Excel MVP

On Tue, 5 Jun 2007 08:06:01 -0700, Diane B
wrote:

I have a file with different row heights; I don't want the rows to be all the
same height - I want them to fit to contents, but I want there to be some
padding between cells. In Word tables you can highlight the rows you want,
regardless of their individual height, and enter whatever cell margin you
want and it affects all selected rows. Is there a way to do this in Excel?
Thanks!




All times are GMT +1. The time now is 01:34 AM.

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