SkywardPalm
Board Regular
- Joined
- Oct 23, 2021
- Messages
- 61
- Office Version
- 365
- Platform
- Windows
I am attempting to remove items that are in a specific range from a dictionary. It works for the most part, but I am having instances where it is not removing an item even the the names match...
Maybe there is something I'm overlooking?
VBA Code:
'for each cell in range of summary table, if in dict of tab names, remove
For Each c In wsSUMMARY.Range("B17:B226")
key = c.Value
For Each k In sectDict.Keys
'Debug.Print k, sectDict(k)
If sectDict.Exists(key) Then
sectDict.Remove key
Debug.Print "Key #" & k & " " & sectDict(k) & " removed from sections dictionary"
Else
'code to show errors for wrong or not present key
End If
Next k
Next c
Maybe there is something I'm overlooking?