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

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

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,181,622
Messages
5,931,004
Members
436,771
Latest member
kwicol

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