hi
If i've read it right, you want to insert a blank row (or do something) before each row that is not the same as the one above it (except the 1st). Is that right?
if so, try this
Dim matchabove As Boolean
matchabove = True
j = 2
i = 1
blankrow = 0
Do While Cells(j - 1, 1) <> ""
For i = 1 To 2 'no of columns to check
matchabove = matchabove And CBool(Cells(j, i) = Cells(j - 1, i))
Next i
If Not matchabove Then
Rows(j & ":" & j).Insert 'or do whatever you do when the row is unique
j = j + 1 'advance 1 row to account for inserted one
blankrow = 1
matchabove = True
Else: blankrow = 0
End If
j = j + 1
Loop
apologies for it being a bit messy! Please get back to me if you'd like an explanation of anything, or if there's an error!
cheers
Mat
Bookmarks