Hi,
i have a code that works great, when you type in a name it will automatically update the main list with that persons name, I would also like the code to copy and paste the row the name is next to in a section above the filtered list. How do I go about this.
This code is
Sub FindValues()
Dim lookUpSheet As Worksheet, updateSheet As Worksheet
Dim i As Long, t As Long
Set lookUpSheet = Worksheets("Interface")
Set updateSheet = Worksheets("Data")
lastRowLookup = lookUpSheet.Cells(Rows.Count, "C").End(xlUp).Row
lastRowUpdate = updateSheet.Cells(Rows.Count, "C").End(xlUp).Row
For i = 2 To lastRowLookup
For t = 2 To lastRowUpdate
If updateSheet.Cells(t, 4) = lookUpSheet.Cells(i, 4) And updateSheet.Cells(t, 10) = lookUpSheet.Cells(i, 10) Then
updateSheet.Cells(t, 3) = lookUpSheet.Cells(i, 3)
Exit For
End If
Next t
Next i
End Sub
i have a code that works great, when you type in a name it will automatically update the main list with that persons name, I would also like the code to copy and paste the row the name is next to in a section above the filtered list. How do I go about this.
This code is
Sub FindValues()
Dim lookUpSheet As Worksheet, updateSheet As Worksheet
Dim i As Long, t As Long
Set lookUpSheet = Worksheets("Interface")
Set updateSheet = Worksheets("Data")
lastRowLookup = lookUpSheet.Cells(Rows.Count, "C").End(xlUp).Row
lastRowUpdate = updateSheet.Cells(Rows.Count, "C").End(xlUp).Row
For i = 2 To lastRowLookup
For t = 2 To lastRowUpdate
If updateSheet.Cells(t, 4) = lookUpSheet.Cells(i, 4) And updateSheet.Cells(t, 10) = lookUpSheet.Cells(i, 10) Then
updateSheet.Cells(t, 3) = lookUpSheet.Cells(i, 3)
Exit For
End If
Next t
Next i
End Sub