Hi,
I have some code that I found and modified for my workbook but I can't figure out what exactly is going on. Normally I can put two and two together but here I am stumped, even though it is only a few lines. If anyone could explain to me what the key command function are I would be most appreciative.
This macro groups like entries as defined in Column A by inserting blank rows between the data, for example:
Before:
ITEM 1
ITEM 1
ITEM 1
ITEM 2
ITEM 2
ITEM 3
After:
ITEM 1
ITEM 1
ITEM 1
ITEM 2
ITEM 2
ITEM 3
And here is the relevant code:
Dim i As Long
For i = Cells(Rows.Count, "A").End(xlUp).Row To 2 Step -1
If Cells(i, "A") <> Cells(i - 1, "A") _
And Cells(i, "A") <> "" _
And Cells(i - 1, "A") <> "" Then
Rows(i).Insert
End If
Next
Could someone please interpret what each line is doing?
Bookmarks