IN A MACRO HOW CAN I INSERT BLANK LINES AFTER EACH PART NUMBER 3RD

G

Guest

TRI-MARK CORP 10 12423363-001
TRI-MARK CORP 11 12423363-001
TRI-MARK CORP 9 12423363-002
TRI-MARK CORP 10 12423363-002
TRI-MARK CORP 8 12423365
TRI-MARK CORP 9 12423365
TRI-MARK CORP 10 12423365
TRI-MARK CORP 10 12423362-003
TRI-MARK CORP 11 12423362-003
TRI-MARK CORP 12 12423362-003
TRI-MARK CORP 11 12423362-004
TRI-MARK CORP 12 12423362-004
 
G

Guest

Sub linin()
n = Cells(Rows.Count, "C").End(xlUp).Row
For i = n To 2 Step -1
If Cells(i, 3).Value <> Cells(i - 1, 3).Value Then
Cells(i, 3).EntireRow.Insert
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top