View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Deleting Rows with Too Many of the Same Number

How about putting this in H1
=MAX(COUNTIF(A1:g1,A1:g1))
This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

And drag down.

Now you can just filter by that column to show 4 and delete the visible rows.

If you need a macro, you could record one when you did it manually.

Losse wrote:

I have seven columns, A-G. All of these columns have different
quantities of whole numbers 1-7. I'd like to make a macro to go through
row by row and delete any rows that have more than 4 of the same numbers
in the same row. How would I go about doing this?

--
Losse
------------------------------------------------------------------------
Losse's Profile: http://www.excelforum.com/member.php...o&userid=24813
View this thread: http://www.excelforum.com/showthread...hreadid=559436


--

Dave Peterson