double spacing

jdhomeguy

New Member
Joined
Nov 3, 2005
Messages
2
Have a spreadsheet with continuous rows. How can I automatically insert a blank row into the sheet for more readability?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Rather than doing that, would simply making the row height greater do the trick? Inserting blank rows can make data selection a royal pain to experienced users who like to use End-Down or Ctrl+*.
 
Upvote 0
This is a generic routine that I wrote years ago to do just that. It's designed to run from a button, hence the use of selection. It could easily be modified to receive a range and work with that.

<font face=Courier New><SPAN style="color:#007F00">'------------------------------------------------------------------------------</SPAN>
<SPAN style="color:#00007F">Sub</SPAN> InsertEveryOtherRow()
    <SPAN style="color:#007F00">'If TypeName(Selection) <> "Range" Then BadSelectionMessage "InsertEveryOtherRow", TypeName(Selection)</SPAN>
    <SPAN style="color:#00007F">Dim</SPAN> rngSelection <SPAN style="color:#00007F">As</SPAN> Range, rngToChange <SPAN style="color:#00007F">As</SPAN> Range, rngRowOne <SPAN style="color:#00007F">As</SPAN> Range
    <SPAN style="color:#00007F">Dim</SPAN> sngDesiredHeight <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Single</SPAN>, lngRowCount <SPAN style="color:#00007F">As</SPAN> <SPAN style="color:#00007F">Integer</SPAN>, i&
    
    sngDesiredHeight = InputBox("Enter a desired height for the new rows", "Height", 3)
    <SPAN style="color:#00007F">Set</SPAN> rngSelection = Selection
    <SPAN style="color:#00007F">With</SPAN> rngSelection
        <SPAN style="color:#00007F">If</SPAN> .Rows.Count = 1 And .Columns.Count = 1 <SPAN style="color:#00007F">Then</SPAN>
            <SPAN style="color:#00007F">Set</SPAN> rngToChange = .CurrentRegion
        <SPAN style="color:#00007F">Else</SPAN>
            <SPAN style="color:#00007F">Set</SPAN> rngToChange = rngSelection
        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">If</SPAN>
    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN>
    <SPAN style="color:#00007F">With</SPAN> rngToChange
        <SPAN style="color:#00007F">Set</SPAN> rngRowOne = .Rows(1)
        lngRowCount = .Rows.Count
    <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN>
    <SPAN style="color:#00007F">For</SPAN> i = 1 <SPAN style="color:#00007F">To</SPAN> lngRowCount * 2 - 1 <SPAN style="color:#00007F">Step</SPAN> 2
        <SPAN style="color:#00007F">With</SPAN> rngRowOne
            .Offset(i, 0).EntireRow.Insert
            .Offset(i, 0).RowHeight = sngDesiredHeight
        <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN>
    <SPAN style="color:#00007F">Next</SPAN> i
<SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN>
<SPAN style="color:#007F00">'------------------------------------------------------------------------------</SPAN></FONT>

HTH
 
Upvote 0

Forum statistics

Threads
1,203,525
Messages
6,055,916
Members
444,834
Latest member
ComputerExcel

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