Insert a row after each account no change

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to set the macro for insert a row automatically after each account no ?
 
Sub Accounts()
Dim rng As Range, i As Long
Set rng = Cells(Rows.Count, 1).End(xlUp)
For i = rng.Row To 1 Step -1
If Cells(i + 1, 1).Value <> Cells(i, 1).Value Then
Cells(i + 1, 1).EntireRow.Insert
End If
Next

End Sub

--
Regards,
Tom Ogilvy



Janmy said:
How to set the macro for insert a row automatically after each account no
?
 

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

Back
Top