+ Reply to Thread
Results 1 to 2 of 2

Faster way to delete?

  1. #1
    Registered User
    Join Date
    05-06-2005
    Posts
    1

    Faster way to delete?

    Sounds like a silly question, but our systems at work spit out tens of thousands of lines of data at a time. For my reports, I have delete all but maybe 50-100 lines. Is there a quick way to do this? Thanks.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,820
    You don't supply much detail, but I expect it should be possible to program a Sub procedure to do this. Here's what I envision it would look like. Note that I'm not using syntactically correct VBA statements so much as just outlining the program structure.

    Sub deleteexcess()
    import data
    for each row in data set
    determine if you want to keep this row
    If yes, then proceed to next row
    If no, then delete this row, shifting the rows below it up.
    proceed to next row
    End Sub

    Once you specify how to determine what rows to delete, then it's a simple matter of using the .entirerow.delete method on the desired row. See delete method as it applies to range in VBA online help.

+ 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