+ Reply to Thread
Results 1 to 3 of 3

Macro that Deletes All rows except first row

  1. #1
    Registered User
    Join Date
    07-18-2006
    Posts
    2

    Macro that Deletes All rows except first row

    Greetings everyone!

    How can I delete all rows in an excel sheet except the first row?

    I have an excel sheet where the first row has header information and the subsequent rows contains data. I would like to run a vba macro that clears/delete all the data , starting from row 2, in the excel sheet but retains the header information in row 1.

    Curtney Jacobs

  2. #2
    Forum Contributor
    Join Date
    03-24-2004
    Location
    Edam Netherlands
    Posts
    181
    Rows(1).Offset(1, 0).Resize(Rows.Count - 1).ClearContents

  3. #3
    Registered User
    Join Date
    07-18-2006
    Posts
    2
    Thanks, that did the trick! All the rows get deleted from row 2 onwards!

    Is there a way to reset the active cell back to the second row after deletion? Meaning the active row/cell should be the second row again.

    Thanks,

    Curtney

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1