Hello,
I'm trying to populate the yellow cells with the same values as shown in the green cells using the dictionary object. What am I doing wrong?
I appreciate your help.
Hello,
I'm trying to populate the yellow cells with the same values as shown in the green cells using the dictionary object. What am I doing wrong?
I appreciate your help.
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
Thanks. I studied the content of the links to be able to get the content of the first array to the second. I tried with
but the b(i, ii) = .Item(b(i, 1))(ii) did not bring the content of the first array, but gives a type mismath error.b = ActiveSheet.Range("J2:L9").Value For i = 1 To UBound(b, 1) If .Exists(b(i, 1)) Then For ii = 1 To number_of_columns b(i, ii) = .Item(b(i, 1))(ii) Next ii End If Next i End With
did not bring me any closerb(i, ii) = a(b(i, 1), (ii))
b(dimension, index) = a(dimension(index, index), (index))b(i, ii) = a(b(i, 1), (ii))
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
I give up
This is meaninglessShow the entire code. What you showed in posts #3 and #4 is not enough.a(b(i, 1), (ii))
I expect the student to do their homework and find all the errrors I leeve in.
Please take the time to read the Forum FAQ
You will have to put the values into the dictionary first
b = ActiveSheet.Range("J2:L9").Value with createobject("scripting.dictionary") For i = 1 To UBound(b, 1) .item(b(i,1))=application.index(b,i) Next msgbox join(.item()(3)) End With
The code is
Sub Start_It() number_of_columns = 2 a = ActiveSheet.Range("A2:C30").Value With CreateObject("Scripting.Dictionary") For i = 1 To UBound(a, 1) .Item(a(i, 1)) = a(i, 1) For ii = 1 To number_of_columns .Item(a(i, 1 + ii)) = a(i, 1 + ii) Next ii Next b = ActiveSheet.Range("J2:L9").Value For i = 1 To UBound(b, 1) If .Exists(b(i, 1)) Then For ii = 1 To number_of_columns b(i, ii) = a(b(i, 1), (ii)) Next ii End If Next i End With ActiveSheet.Range("K2:L9").Value = b End Sub