Formatting cell for space above and below text

pilot

Active Member
Joined
Feb 17, 2002
Messages
345
I'm looking for the equivalent of Word's paragraph formatting where you can add space before and after a paragraph. In Excel with wrap text turned on, I currently change row height manually to give the same visual appearance but I'm looking for how to automate it. Ideally would like to have row height be 12 points greater than Excel currently makes it.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try the following in a standard module

Code:
Sub test()
    With ActiveCell
        ' first fit in standard manner
        .Rows.AutoFit

        'align the text vertically
        .VerticalAlignment = xlCenter
        
        'wrap the text
        .WrapText = True
        
        'increase the row height
        .RowHeight = .RowHeight + 12
    End With
    
End Sub
 
Upvote 0
On the right track

That code gets me on the right track. Instead of doubling the calculated row height, I would like to add 12 points. What would the appropriate change to this line be?

.RowHeight = .RowHeight * 2

Then I will make the macro auto-run whenever any cell is changed.
 
Upvote 0
Disregard my last post, I see you edited your response. Thanks, this works great!
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top