Cell A1: 001-001, 004-006, 007-090, 004-006, 100-300, 040-001, 090-001, 500-555
suppose we have the content in cell A1.
I have a working function from this forum that works (i.e. remove duplicates)
Now, I have need to modify the IF statement to NOT add the "040-001" and the the likes (090-001), but I need to keep the "001-001". I know 001-001 is one variant of ###-001. Would be great if someone with more brain power to help me out with this logic. Thanks!
...
...
For Each x In Split(txt, delim)
if Trim(x) <> "" AND Not .exists(Trim(x)) AND Not (Trim(x) Like "###-001") Then .add Trim(x), Nothing 'This works, but it also don't add the 001-001 record
Next
...
...
Furthermore, I would like to develop a logic where the not to pick up any string that the first 3#s is greater than the 3#s after the dash. e.g. 100-101 => add, 100-001 => do not add to final list
I know this will involve converting the string to number with 3 digits and compare the first 3-digit number to the 2nd 3-digit number.
Thanks in advance.
Bookmarks