Thread: [Solved] Remove rows less than 10
View Single Post
 
Old 07-15-2014, 09:12 AM
BobBridges's Avatar
BobBridges BobBridges is offline Windows 7 64bit Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Gbaker, in the attached sample the rows are sorted by the value you're using to determine whether the row should be deleted. Thus you can just delete the last n rows manually. There's no real reason you shouldn't write a macro to do it, but it may be more work than it's worth.

Possible answer #1: Yeah, but this seemed like a good example for me to use to start learning how to write macros. Excellent! I'll help.

Possible answer #2: In real life it won't always be sorted that way. Ok; in that case, how many rows are there likely to be? If it's only a few hundred it's no problem; if it's tens of thousands the macro may run a little slow. (Nothing like as slow as it would be to do it manually, of course.)

Possible answer #3: Oh, duh! Of course you're right. Never mind. I don't really expect that, but it's well to ask.

Possible answer #4: Something I didn't think of.

By the way, since this is a macro question it should be posted in the Excel-Programming forum rather than here. If another moderator doesn't beat me to it, I'll move it there as soon as I can remember how :-).
Reply With Quote