excel - How do I remove duplicate values in a cell seperated with a /? -
i have multiple cells in excel have follows:
b1= e4i8/e4i8/e4i8/e4i8 b2=d3b2/b30c1/d3b2/d3b2/d3b2/b30c1 multiple /xxxx/ how remove these duplicate text strings in same cell?
thank you
this function uses keys of dictionary build unique list of parts passed-in string (add reference microsoft scripting runtime):
public function uniqueparts(separator string, toparse string) string dim d new scripting.dictionary, part variant, integer each part in split(toparse, separator) d(part) = 1 next uniqueparts = join(d.keys, "/") end function you can use function in excel formula:
=uniqueparts("/","e4i8/e4i8/e4i8/e4i8") or cell reference:
=uniqueparts("/",b2) you can use inside macro iterates on range of cells.
Comments
Post a Comment