Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting data BELOW a predetermined number of rows 1

Status
Not open for further replies.

t16turbo

Programmer
Mar 22, 2005
315
GB
I need to determine the last row of data, going by a specified field.

I then need to delete all data below that!

once I have found the last row containing the data I want, how can I then delee eveything below it?
 
You can find the last row by the methods we discussed in thread707-1145669. To get rid of all data below that you can use the fact that there are only 65,536 rows. This is basically the inverse of what was in the other thread:

[COLOR=blue white]range([b65536].end(xlup).offset(1), [65536:65536]).delete[/color]

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
thanks John,

yeah, I was using the method we discussed earlier - just wasn't thinking very effectively about how to do away with the data below - but looking at what you have written - it all makes perfect sense!! :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top