First off: Windows 7 and Excel 2010
I have a massive spreadsheet and need to put a blank row after entries when the information in column T changes. Let's say the following is column T.
Blue
Blue
Blue
Red
Red
Red
Yellow
I want to insert a blank row after the 3rd Blue and 3rd Red and so on........ Below is the VBA someone gave me to try in Excel 07 and it worked perfectly. Perhaps it will help with your answer. It does not work in Excel 2010. Thank you in advance.
Sub test()
Columns("u").Insert
Columns("u").Clear
With Range("t2", Range("t" & Rows.Count).End(xlUp)).Offset(, 1)
.Formula = "=if(and(t1<>"""",t2<>"""",t1<>t2),if(u1=1,""a"",1),"""")"
.Value = .Value
On Error Resume Next
.SpecialCells(2, 1).EntireRow.Insert
.SpecialCells(2, 2).EntireRow.Insert
On Error GoTo 0
End With
Columns("u").Delete
End Sub
Bookmarks