3 out of 4 numbers combinations macro deleting?

Status
Not open for further replies.

excelNewbie22

Well-known Member
Joined
Aug 4, 2021
Messages
510
Office Version
  1. 365
Platform
  1. Windows
hello,
i'm trying again since last time i didn't got a right solution (and THANKS to the one's who tried )

how can i delete all rows containing any combo of 3 numbers out of 4 predefined numbers ?

range is always a:d for unknown numbers of rows
in here i'm writing two examples,
but the macro should handle only one example=predefined numbers:

example 1:
column e is for predefined numbers 1-2-3-4 and any combo's of 3 unique numbers need to be deleted
like 1-2-3-5 or 4-2-3-8 but not when one of the three is a duplicate one like 1-2-3-3

example 2:
column f is for predefined numbers 5-5-4-3 and any combo's of 3's need to be deleted
but the thing with 5543 is there a duplicate number which is '5', so any combo of 3's in this case will always include a '5'
(554x 5x53 x435 when x could be any number... and so on)

and maybe use an array for me to be able to change when needs to?

y=keep
x=delete

example.xlsx
ABCDEF
11111yy
21112yy
31125yy
41218yy
51221yy
61222yy
71317yy
81341xy
91352xy
102111yy
112112yy
122347xy
132348xy
142354xx
152435xx
162551yy
172553yx
182581yy
192582yy
202622yy
212623yy
222812yy
233132xy
243242yy
253335yy
263531yy
273532yy
284134xy
294151yy
304132xy
314415yy
324518yy
334557yx
345121yy
355122yy
365332yy
375527yy
386132xy
396133yy
406216yy
416217yy
426462yy
436526yy
446527yy
457113yy
467234xy
477334yy
487441yy
497442yy
507655yy
517656yy
528111yy
538121yy
548122yy
558222yy
568223yy
578345xx
588543yx
598553yx
608554yx
618711yy
628834yy
e-1234+f-5543
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Duplicate to: macro deleting 3 out of 4 in any combo

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread.
 
Upvote 0
apologize, i thought opening new thread would be easier for members to try and help me then going through several pages
thank you
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,863
Messages
6,121,978
Members
449,058
Latest member
oculus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top