Intersting a line

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
If you don't have any other special formatting in the sheet, then you can quickly do it without macros (and assuming the line is actually a cell border).

Insert the first Line/border in the 8th row.
Select all cells above and including the 8th row.
Click the Format Painter button (looks like a paintbrush)
then select all the column headers (i.e. A,B,C...) for which you want to add the line to every 8th row.

Beware: this will also copy any other formats within those eight rows (which may be a good thing depending on why you are dividing the sheet up). Then all formats would copy down in the same fashion as the line.

Hope this helps.
 
Upvote 0
Yes, I am sure it could, but I not too well versed in VBA and wouldn't want to steer you in the wrong or in a complicated direction.

Note: What I showed you, though, would take less than a minute to accomplish. Why wouldn't that work for you?

I will leave the macro-writing to other MrExcel members who could easily do that for you.
 
Upvote 0
This requires a macro, then.

I'm sure someone can write you a simple one that would do both your requests.
 
Upvote 0
Code:
Sub InsertRow()
    LastRow = ActiveSheet.UsedRange.Rows.Count
    
    For i = 8 To LastRow Step 8
        Rows(i + Round(i / 8, 0) - 1).EntireRow.Insert
        Rows(i + Round(i / 8, 0) - 1).Borders(xlEdgeBottom).LineStyle = xlContinuous
    Next i
End Sub
 
Upvote 0

Forum statistics

Threads
1,203,667
Messages
6,056,651
Members
444,880
Latest member
Kinger1968

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