ExcelVBAそのものには連想配列(マップ)を扱う型は用意されていない。
が、Windowsのディクショナリーが使える。
Dim dict As Object Set dict = CreateObject("Scripting.Dictionary") dict("abc") = "value1" dict("def") = "value2" Debug.Print dict("abc") Dim key As Variant For Each key In dict.Keys Debug.Print key, dict(key) Next
ExcelVBAでは、MkDirでディレクトリーを作成することが出来る。
が、すぐ上の親ディレクトリーが存在しない場合に再帰的に作成してはくれない。
自分で作ると以下のような感じ。
Sub MkDirs(ByRef path As String) '存在していたら何もしない If Dir(path, vbDirectory) <> "" Then Exit Sub Dim n As Integer n = InStrRev(path, "\") If n >= 0 Then Call MkDirs(Left$(path, n - 1)) End If MkDir path End Sub