aflatoon thanks but still gives the same error .actually I add this
this work up to this lineIf Not dic.exists(a(i, 3)) Then Set dic(a(i, 3)) = CreateObject("Scripting.Dictionary") End If If Not dic(a(i, 3)).exists(a(i, 4)) Then Set dic(a(i, 3))(a(i, 4)) = CreateObject("Scripting.Dictionary")gives error mismatch. my knowladge in vba is not good but I try learning . cany you guide me please?dic(a(i, 2))(a(i, 3))(a(i, 4))(a(i, 5)) = a(i, 6)