Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata
Public Sub TestDicFun()
 Dim WOsDic As Object
 Set WOsDic = FindWOsDic(ResultsWS)
 Dim k
 For Each k In WOsDic.keys
  Debug.Print k, WOsDic(k)
 Next k
End Sub
Public Function RangeToDic(rng As Range) As Object
 Set RangeToDic = CreateObject("scripting.dictionary")
 Dim tmp As String
 Set TempDic = CreateObject("scripting.dictionary")
  For Each rcell In rng.Cells
   tmp = Trim(rcell.Value)
   If Not TempDic.Exists(tmp) Then
    If Len(tmp) > 0 Then TempDic(tmp) = TempDic(tmp) + 1
   End If
  Next rcell
  Set RangeToDic = TempDic
End Function
  • No labels