Working with dictionaries in VBA is a bit more unpleasant, than working with dictionaries with almost any other language. Because of the VBA IDE, you only see the keys, but not the values. Thus, if you have experience with Visual…
Transforming Range to Array in VBA is actually a one liner – we take the range and we assign it to a variant:
1 2 3 4 5 |
Dim myRange As Range Set myRange = Range("a1").CurrentRegion Dim myArray As Variant myArray = myRange |
The “strange” part is that the array is converted to 2-dimensional array after this: and working…
Intersection of dictionary (or of any two lists) is a list with elements, that are present in both other lists. Thus, if we have the following 3 dictionaries in Python:
1 2 3 |
dict_a = dict([('aa', 4139), ('bb', 4127), ('cc', 4098)]) dict_b = dict(aa=4139, bb=4127, ee=4098) dict_c = {'aa':12, 'bb':13, 'dd':23} |
Then, an intersection of their keys will contain only…