get unique values as well as the empty string in excel vba -
how can modify code give empty strings in range
sub getuniqueandcount() dim d object, c range, k, tmp string set d = createobject("scripting.dictionary") each c in selection tmp = trim(c.value) if len(tmp) > 0 d(tmp) = d(tmp) + 1 next c each k in d.keys debug.print k, d(k) next k end sub
just remove test length of tmp , should it:
sub getuniqueandcount() dim d object, c range, k, tmp string set d = createobject("scripting.dictionary") each c in selection tmp = trim(c.value) d(tmp) = d(tmp) + 1 next c each k in d.keys debug.print k, d(k) next k end sub
Comments
Post a Comment