madhuchelliah
Board Regular
- Joined
- Nov 22, 2017
- Messages
- 226
- Office Version
- 2019
- Platform
- Windows
Hello all, i have multiple sentences in column B, range is dynamic which has to be segregated based on identifying it's 1st word and has to be copied to column C and stacked under each other cell. The 1st word of each sentence falls under any of the format as follows.
1. Third character of the word is Hyphen (-)
2. Third character of the word is Alphabet A (A)
3. Contains two or more Hyphens (AA-BCC-VVVVVV)
4. Contains forward slash (AA/BCC)
5. Contains Dot(s) (AA.BCC)
6. Starts with RR (RRXXXXX)
7. Starts with TBD
The macro has to identify the individual sentences based on the above formats and separate it to column C in diiferent cells. All the cells may not have the multiple sentences and all cells may not have sentences with all the formats mentioned above. It no multiple sentence found just copy the one sentence as it is to coumn C. Please see the example for better clarity. Thank you.
1. Third character of the word is Hyphen (-)
2. Third character of the word is Alphabet A (A)
3. Contains two or more Hyphens (AA-BCC-VVVVVV)
4. Contains forward slash (AA/BCC)
5. Contains Dot(s) (AA.BCC)
6. Starts with RR (RRXXXXX)
7. Starts with TBD
The macro has to identify the individual sentences based on the above formats and separate it to column C in diiferent cells. All the cells may not have the multiple sentences and all cells may not have sentences with all the formats mentioned above. It no multiple sentence found just copy the one sentence as it is to coumn C. Please see the example for better clarity. Thank you.
Book2.xlsm | ||||
---|---|---|---|---|
B | C | |||
3 | ||||
4 | ||||
5 | Input in Column B | Expected output in Column C | ||
6 | 11-2525CD XXXX, AAAA, BBBBBB, CCCC 32A2315 CCCC, CCCCDDDD, DDDD. EEEEEEEE AB-CD-EFR2 V158VV, RR65RR, TTTTT358T ABC/DEF/25-256 GGG, HHHHH, TTTTT, UUUUUUU AA.BB.CCC CCCC, CCCC3444D, DDDD. EEEEEEEE RR25-5487 V158VV, RR65RR, TTTTT358T TBD A2552DDD, CCCC, C5C25D3D | 11-2525CD XXXX, AAAA, BBBBBB, CCCC 32A2315 CCCC, CCCCDDDD, DDDD. EEEEEEEE | ||
7 | 32A2315 CCCC, CCCCDDDD, DDDD. EEEEEEEE | |||
8 | AB-CD-EFR2 V158VV, RR65RR, TTTTT358T | |||
9 | ABC/DEF/25-256 GGG, HHHHH, TTTTT, UUUUUUU | |||
10 | AA.BB.CCC CCCC, CCCC3444D, DDDD. EEEEEEEE | |||
11 | RR25-5487 V158VV, RR65RR, TTTTT358T | |||
12 | TBD A2552DDD, CCCC, C5C25D3D | |||
13 | ||||
14 | ||||
15 | ||||
16 | ||||
17 | 11-2525CD XXXX, AAAA, BBBBBB, CCCC 32A2315 CCCC, CCCCDDDD, DDDD. EEEEEEEE | 11-2525CD XXXX, AAAA, BBBBBB, CCCC | ||
18 | 32A2315 CCCC, CCCCDDDD, DDDD. EEEEEEEE | |||
19 | ||||
20 | ||||
21 | ||||
22 | ||||
23 | ||||
24 | ||||
25 | ABC/DEF/25-256 GGG, HHHHH, TTTTT, UUUUUUU | ABC/DEF/25-256 GGG, HHHHH, TTTTT, UUUUUUU | ||
26 | ||||
27 | ||||
28 | ||||
Sheet1 (3) |