連想配列
Public Sub 連想配列の定義() Dim sheet_clt As String sheet_clt = "クライアント" Dim i As Long Set dicT = CreateObject("Scripting.Dictionary") ' For i = 1 To 20 ReDim Preserve list_clt_id(i) ReDim Preserve list_clt_name(i) list_clt_id(i) = Worksheets(sheet_clt).Cells(i, 1).Value list_clt_name(i) = Worksheets(sheet_clt).Cells(i, 2).Value key = Worksheets(sheet_clt).Cells(i, 1).Value dicT(key) = dicT(key) + Worksheets(sheet_clt).Cells(i, 2).Value Next i 'For i = 1 To UBound(keys_all) ' MsgBox "*kekka : " & dicT(keys_all(i)) 'Next i End Sub