I'm trying to organize some data that was dumped out of a proprietary system into something I can use. In column A, I want to put a 'group by' number.
It dumps this long, spanning row out that separates the different duplicates. Whenever it hits a spanning row, I want it to increment the counter, and delete the spanning row.
The before data is this (I manually keyed A3, A4, A6, A7, A8, A10, A11):
I'd like the after data to look like this:
Any ideas how to accomplish this?
Final solution made possible by comment from below:
Public Sub CleanMeImFilthy() Dim intCounter As Integer Dim i As Integer i = 1 For intCounter = ActiveSheet.UsedRange.Rows.Count To 1 Step -1 If Trim(LCase(Left(Cells(intCounter, 1).Value, 14))) = "duplicate key:" Then Rows(intCounter).Delete i = i + 1 Else Rows.Cells(intCounter, 1) = i End If Next End Sub