I keep getting error '483': Object doesn't support this property or method on he highlighted line. I'm a complete beginner with excel-vba and I am trying to learn it by myself.
Sub Magic()
Dim i As Integer, j As Integer, k As Integer
Dim featcode(9999)
Dim partnum(9999)
k = 4
i = 0
j = 0
For i = 2 To 616
featcode(i) = Cells(i, 1).Value
Next i
For j = 1 To 9999
partnum(j) = ThisWorkbook.Worksheets(3).Cells(j, 8).Value
Next j
For i = 2 To 616
For j = 1 To 1000
If featcode(i) = partnum(j) Then
**ThisWorkbook.Worksheets(2).Cells(i, k).Value = ThisWorkbook.Worksheets(3).partnum(j).Value**
k = k + 1
End If
Next j
k = 4
Next i
End Sub
partNum(j)is going to be a value, you can't do.Value.Value. What ispartNum(j)? Is that a value for a row, or column? You're missing whatCell()you want to putpartNum(j)in, if that was your intention. Can you explain what the sub is supposed to do?ThisWorkbook.Worksheets(2).Cells(i, k).Value = partnum(j). That's why you have the array in the first place, no ?..= partnum(j)you dont need the reference to the Worksheet