Copy and paste

Eve05

New Member
Joined
Sep 21, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
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
 

Attachments

  • Screenshot 2020-10-08 200927.png
    Screenshot 2020-10-08 200927.png
    14.1 KB · Views: 8

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top