increase cell margins globally like word?

G

Guest

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!
 
G

Gord Dibben

Horizontally you can pad using Format>Cells>Alignment>Indent.....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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top