Using vlookup to paste in corresponding row

nrb4480

Board Regular
Joined
Jun 19, 2008
Messages
69
Is there some way to modify this code:

If Not Intersect(Target, Range("C6")) Is Nothing Then
With Sheets("Data Set").Range("D4:D43")
Set c = .Find(Range("C6").Value, LookIn:=xlValues)

To find the value in a table, highlight a range in my current sheet (Data Entry Form) and paste in the corresponding row (the row where the inital range was found).

I am looking for a way to replace existing data without having to type the following in for each row:

ElseIf Sheets("Data Entry Form").Range("$AM$3") = 42 And Sheets("Data Entry Form").Range("$B$8") = Sheets("Data Set").Range("$A$37") Then

Sheets("Data Entry Form").Range("x3:AL3").Copy
Sheets("Data Set").Range("$B$37:$P$37").PasteSpecial _
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False

Sheets("Data Entry Form").Range("X7:Ay7").Copy
Sheets("IE Evaluation Results").Range("$b$37:$AC$37").PasteSpecial _
Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False

Please help!!!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
With this code:
If Not Intersect(Target, Range("C6")) Is Nothing Then
With Sheets("Data Set").Range("D4:D43")
Set c = .Find(Range("C6").Value, LookIn:=xlValues)
End If
in the Worksheet_Change subroutine on the Data Entry form, c.row will be the row that the target data is found in.

I am not sure how this result can be tied to the code in the bottom half of your post.

Please use Excel Jeanie (http://www.excel-jeanie-html.de/index.php?f=1) to post enough of your workbooks so that we can fully understand what you are trying to do.
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

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