Computing.Net > Forums > Office Software > inserting rows macro

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

inserting rows macro

Reply to Message Icon

Name: Lunger
Date: July 19, 2009 at 16:44:31 Pacific
OS: Windows XP
Product: Microsoft Excel 2000/visual basic for applications fundamentals
Subcategory: General
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: DerbyDad03
Date: July 20, 2009 at 13:10:47 Pacific
Reply:

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


0

Response Number 2
Name: Lunger
Date: July 22, 2009 at 16:11:52 Pacific
Reply:

Thanks DerbyDad. You rock Dude!!!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Problems with Russian Pro... Picture Manager not insta...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home


Sponsored links

Ads by Google


Results for: inserting rows macro

Macro - Inserting rows into Excel www.computing.net/answers/office/macro-inserting-rows-into-excel/5107.html

insert row if a new item appear www.computing.net/answers/office/insert-row-if-a-new-item-appear/9167.html

How do I select newly inserted rows? www.computing.net/answers/office/how-do-i-select-newly-inserted-rows/9780.html