Hi Dhiraj,
Are you working on the real data or on the sample CSVs you posted here ?
Anyway replace the For Next statement with the following.
Let me know what the MsgBox says once it error out.Code:For c = 1 To UBound(d, 2) If Len(Trim$(d(1, c))) Then j = dic.Item(Trim$(d(1, c))) On Error Resume Next k(n, j) = d(r, c) If Err.Number <> 0 Then MsgBox "Total Columns so far " & dic.Count & vbLf & _ "Counter :" & n & vbLf & _ "Current Col:" & j Err.Clear: On Error GoTo 0 Exit Sub End If End If Next
Bookmarks