Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Create Dic:

Public MyDic As Object   
Public Sub TestDic()
Dim k, tmp As String

 Set  MyDic = CreateObject("scripting.dictionary")
 For Each rcell In Rng.Cells
  tmp = Trim(rcell.Value)
  'If Len(tmp) > 0 Then  MyDic (tmp) =  MyDic (tmp) + 1
   If Len(tmp) > 0 Then  MyDic .Add Key:=tmp, Item:=rcell.Offset(0,1).Value
 Next c

 For Each k In  MyDic.keys
  Debug.Print k,  MyDic (k)
 Next k

End Sub


dict.Remove Key


dict.Add Key:="Orange", Item:=45
  • No labels