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

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -