farhan11941234
New Member
- Joined
- Dec 14, 2019
- Messages
- 29
- Office Version
- 365
- Platform
- Windows
ws.Range("A:B").RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes
thanks for this great sub its working fine, could you please modify the sub as i have attached images.
Book1 | ||||||||
---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | |||
1 | ID | Product | Name | Addrss | Rate | Cell No | ||
2 | 100001 | A | John | 123 | 345 | |||
3 | 100001 | B | John | 123 | 2 | 345 | ||
4 | 100002 | A | Bill | xyz | 321 | |||
5 | 100002 | B | Bill | xyz | 2 | 321 | ||
6 | 100002 | C | Bill | xyz | 321 | |||
7 | 100003 | A | Will | Asd | 301 | |||
8 | 100003 | B | Will | Asd | 4 | 301 | ||
9 | 100003 | C | Will | Asd | 301 | |||
10 | 100004 | A | Harry | Ghq | 300 | |||
11 | 100004 | B | Harry | Ghq | 6 | 300 | ||
12 | 100005 | A | Superman | jkl | 390 | |||
13 | 100006 | A | Batman | mno | 287 | |||
14 | 100007 | A | Joker | qwe | 210 | |||
15 | 100008 | A | Alen | Poiuy | 654 | |||
16 | 100008 | B | Alen | Poiuy | 8 | 654 | ||
17 | 100008 | C | Alen | Poiuy | 654 | |||
18 | Sample Data | |||||||
19 | ||||||||
20 | ||||||||
Sheet1 |
Book1 | ||||||||
---|---|---|---|---|---|---|---|---|
J | K | L | M | N | O | |||
1 | ID | Product | Name | Addrss | Rate | Cell No | ||
2 | 100001 | A+B | John | 123 | 2 | 345 | ||
3 | 100002 | A+B+C | Bill | xyz | 2 | 321 | ||
4 | 100003 | A+B+C | Will | Asd | 4 | 301 | ||
5 | 100004 | A+B | Harry | Ghq | 6 | 300 | ||
6 | 100005 | A | Superman | jkl | 390 | |||
7 | 100006 | A | Batman | mno | 287 | |||
8 | 100007 | A | Joker | qwe | 210 | |||
9 | 100008 | A+B+C | Alen | Poiuy | 8 | 654 | ||
10 | Expected Result | |||||||
11 | ||||||||
12 | ||||||||
Sheet1 |
You should have explained that in post#1
- it looks like your amended requirement requires a different approach
- To maximise your chance of getting a good solution efficiently (for everyone) , I suggest you start a new thread fully explaining what is required and making sure that your sample data is typical of EVERY situation that may arise
Posting data
Images are nice and can be helpful at times but for this type of problem it is usually easier to also have some data that can be grabbed
You may find it useful to load this tool to post sample data into a thread
XL2BB - Excel Range to BBCode
Convert selected range to BBCode to include as a snapshot in your question.www.mrexcel.com
Note - there are a few "teething" issues with this new tool . If you encounter problems click on link below to see if the problem has already been spotted - many problems already have a workaround
About This Board
Discussion of policies, bug reports, how to use it, XL2BB questions, etc.www.mrexcel.com
data in columns C:F is requiredJust a thought - I have looked at your images again
Q Does the data in columns C:F affect the result required in ANY way (except that those columns should be included in the output) ?
- If data in those columns is not required to be interrogated, then only a simple modification to the code is required
Please let me know