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

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -