Having trouble inserting a blank link

FusionRed

New Member
Joined
Nov 4, 2004
Messages
15
I'm trying to create a macro that will find the yellow lines (subtotal lines) and will insert a blank line (no interior color) above and below it. Following is my code, can someone help me find the error of my ways?????

Sub Insert_Blank_Rows()
'
' Insert_Blank_Rows before and after total line in Elabor Budgets
' Macro recorded 1/19/2005 by Pitney Bowes Inc.
'
Dim Cell As Range
Dim r As Range
Set r = Range("E11", Range("E65536").End(xlUp))
For Each Cell In r
If Cell.Interior.ColorIndex = 36 Then
Cell.Offset(1).Interior.ColorIndex = 0
Cell.Offset(1).ClearContents
Cell.Offset(-1).Interior.ColorIndex = 0
Cell.Offset(-1).ClearContents
End If
Next
End Sub

Thank you for your time and expertise.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

FusionRed

New Member
Joined
Nov 4, 2004
Messages
15
I solved the problem of inserting lines. My thanks to everyone who looked.

FusionRed
 

Tazguy37

MrExcel MVP
Joined
May 28, 2004
Messages
4,237
If you would, please post your solution for others who may have the same problem. Thanks!
 

Forum statistics

Threads
1,148,049
Messages
5,744,509
Members
423,881
Latest member
Nguyen Vu

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
Top