View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
J.W. Aldridge J.W. Aldridge is offline
external usenet poster
 
Posts: 425
Default insert blank row

Want to insert blank row right before the first instance where a row
color is gray (color index 41).

Tried to work out the folliowing but no success.

Sub InsertRows()
Dim i As Long
i = 2
Do Until Trim(Cells(i, 1)) = ""
If cell.Interior.ColorIndex = 41 Then
Cells(i, 1).EntireRow.Insert
i = i + 2
Else
i = i + 1
End If
End Sub