excelNewbie22
Well-known Member
- Joined
- Aug 4, 2021
- Messages
- 510
- Office Version
- 365
- Platform
- Windows
i have a file with thousands of lines, each line have 4 cells, each cell have 1 number (no empty lines, starting with a1)
i need a macro which can delete any line/row who doesn't contain the one of the 4 numbers i will set each time
for example: each row who doesn't have either 5 or 4 or 3 or 2 will be deleted, and sometimes the range can be only 2 or 3 numbers (like 5, 4 and 6 or 2 and 1)
can anyone help me out?
i need a macro which can delete any line/row who doesn't contain the one of the 4 numbers i will set each time
for example: each row who doesn't have either 5 or 4 or 3 or 2 will be deleted, and sometimes the range can be only 2 or 3 numbers (like 5, 4 and 6 or 2 and 1)
can anyone help me out?
1234 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | 6 | 6 | 2 | 5 | ||
2 | 6 | 1 | 4 | 4 | ||
3 | 6 | 5 | 5 | 6 | ||
4 | 2 | 2 | 1 | 5 | ||
5 | 4 | 2 | 2 | 1 | ||
6 | 1 | 6 | 1 | 1 | ||
7 | 2 | 2 | 1 | 2 | ||
8 | 2 | 2 | 2 | 5 | ||
9 | 3 | 5 | 1 | 1 | ||
10 | 6 | 1 | 7 | 1 | ||
11 | 4 | 2 | 1 | 1 | ||
12 | 1 | 6 | 6 | 1 | ||
13 | 1 | 3 | 1 | 6 | ||
14 | 3 | 2 | 4 | 5 | ||
15 | 3 | 4 | 6 | 2 | ||
16 | 6 | 5 | 1 | 1 | ||
17 | 5 | 1 | 5 | 4 | ||
18 | 1 | 6 | 2 | 6 | ||
19 | 4 | 1 | 6 | 2 | ||
20 | 2 | 1 | 3 | 3 | ||
21 | 6 | 4 | 4 | 1 | ||
22 | 1 | 3 | 2 | 4 | ||
1234 |