I have a script that was created for a previous request but I am looking to modify it for new data. I have the spreadsheet (attached) and the code below. I am looking to place "Grid ID" numbers starting at B6 and below on the "Customer" tab. Then do a search on the "output" tab and if the "Grid ID" matches, then copy the contents from the "A"column to "Q" column on the "output" tab for that Grid ID and copy it to the "C" to "Q" colums on the corresponding Grid ID line on the "Customer" tab. I know the code is close but not sure what I am missing.
<code>
Option Explicit
Sub nomatchnoty()
Dim X, Z, i As Long, j As Long, n As Long, Y(), dic As Object
With Worksheets("Customer")
X = .Range("a6:Q" & .Range("A" & .Rows.Count).End(xlUp).Row)
End With
Set dic = CreateObject("scripting.dictionary")
dic.comparemode = 1
With dic
For i = 1 To UBound(X, 1)
If Len(X(i, 3)) Then
.Item(X(i, 3)) = i
End If
Next
End With
With Worksheets("Output")
X = .Range("a23:Q" & .Range("A" & .Rows.Count).End(xlUp).Row)
End With
ReDim Y(1 To UBound(X), 1 To UBound(X, 2))
With dic
For i = 1 To UBound(X)
If Len(X(i, 3)) Then
If .exists(X(i, 3)) Then
For j = 4 To UBound(X, 2)
Y(.Item(X(i, 3)), j - 3) = X(i, j)
Next
End If
End If
Next
End With
With Worksheets("Customer")
.Range("C6:Q" & .Rows.Count).ClearContents
.Range("C6").Resize(i - 1, UBound(Y, 2)) = Y
.Columns.AutoFit
End With
End Sub
<code>
Bookmarks