inserting rows macro

Microsoft Excel 2000/visual basic for ap...
July 19, 2009 at 16:44:31
Specs: Windows XP
I have a spreadsheet with 500 rows of data. Column A has my data of interest. After sorting, column A will have several rows of the data are the same, then it changes. The data in column A are names of employees...I need to know the easiest way to insert a blank Row where those names change other than me changing it all manually...Any ideas?

See More: inserting rows macro

Report •


#1
July 20, 2009 at 13:10:47
Try this...

Sub AddRowAtChange()
myRow = 1
 Do Until Cells(myRow + 1, 1) = ""
  If Cells(myRow, 1) <> Cells(myRow + 1, 1) Then _
   Cells(myRow + 1, 1).EntireRow.Insert
    myRow = myRow + 2
 Loop
End Sub


Report •

#2
July 22, 2009 at 16:11:52
Thanks DerbyDad. You rock Dude!!!

Report •

Related Solutions


Ask Question