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.
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.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks