Hi,
I've used the following macro hundreds of times with no problem until today...
Sub InsertRowAtChangeInValue()
Dim lRow As Long
For lRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row To 2 Step -1
If Cells(lRow, "B") <> Cells(lRow - 1, "B") Then Rows(lRow).EntireRow.Insert
Next lRow
End Sub
The macro looks in column B and whenever the value in the following row is different than the value in the previous row, it inserts a row.
so...
Bob
Bob
Bob
John
John
Amy
Sarah
Sarah
Becomes...
Bob
Bob
Bob
John
John
Amy
Sarah
Sarah
...
I've used it in the exact same workbook for I don't know how long...
Now, all of a sudden, whenever I run it I get a "Runtime Error 13: Type Mismatch"
I've looked and looked and tried to figure this out to no avail.
Can anyone out there take a look at this?
Thanks!
R.J.
Bookmarks