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

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

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!
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,151,821
Messages
5,766,638
Members
425,364
Latest member
jstubs99

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