View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
JMB JMB is offline
external usenet poster
 
Posts: 2,062
Default Conditional Row Delete

Correction - almost a good answer. Looks like Don had it right the first
time - more details were needed. But the OP could have set up a helper
column using Countif and filter on the helper column.


"CompleteNewb" wrote:

JMB, this is a PERFECT example of how I always go about things the wrong
way. I was getting ready to reply to this (every decade or so I try to give
something back) with all kinds of ways to check for values less than 5
(assuming that's the question, it might be checking for less than 5
instances of the SIC number in a column) and delete using VBA, and then I
read your post. Autofilter didn't even OCCUR to me.

I have to laugh at myself sometimes.

Good answer, JMB.


"JMB" wrote in message
...
One thing you can try:

First, back up your work.

Then turn on Autofilter (Data/Filter/Autofilter). Click the drop arrow on
SIC Code column. Select custom from the list and "is less than" 5.
Select
the results of the filter and Edit/Delete. Then turn off the autofilter.


" wrote:

Review many postings on conditional row delete but still need help. I
want to delete all rows where there are fewer than 5 companies within
industry. The median within that industry is not very useful if there
are less than 5, or some other number, of companies.

Company SIC Code Sales

If frequency of SIC code is less than 5, then delete the row.

Please help.