+ Reply to Thread
Results 1 to 3 of 3

Delete Rows - as in remove them from the sheet completely?

  1. #1
    Registered User
    Join Date
    10-11-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Delete Rows - as in remove them from the sheet completely?

    Hi! I'm a Noob with VBA, but I've been trying to automate some processes at work. We have an excel file that contains some 70k records, which we download every day. However, we only need records that don't have a cancelled or completed status (Statuses are text in a column). When I manually autofilter to de-include those statuses, I end up with about 6k records of usable data, which is fine, but i wrote a macro to automatically filter the file for those cancelled or completed statuses, select the rows, and delete them. The end result looks about right, but the file takes MUCH longer to open and interact with than the 5k records could be responsible for. Also, when I ask the Immediate window in VBA for a Used Range count, it still includes the deleted records. I've enclosed my code and I hope I'm clear about the trouble.

    (The Rows still show Blue after the Macro runs, but if I manually Select and RightClick->Delete the rows in question, they go away permanent-like.)

    Please Login or Register  to view this content.
    Any help you can provide would be simply neato! Thanks!

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Delete Rows - as in remove them from the sheet completely?

    attach a sample file for testing
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    10-11-2012
    Location
    Philadelphia, PA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete Rows - as in remove them from the sheet completely?

    Hi, I did a little workaround based on what some co-workers said would be a good idea, which is just copy the range from the ss with data still in it into another sheet and then delete the old sheet. The code looks something like:

    Please Login or Register  to view this content.
    So this one is Solved. Well, sorta It's a workaround, but it works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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