VBA Dictionaryの件数を取得する
環境
Windows 10 Home
Excel 2013
構文
ディクショナリ名.Count
countでdictionaryの要素の件数を取得しています。
使用例
Sub testark()
Dim city As Object
Set city = CreateObject("Scripting.Dictionary")
city.Add "ta", "東京"
city.Add "tb", "大阪"
city.Add "tc", "福岡"
Debug.Print city.Count
End Sub
実行結果
3