Copy row information one workbook to another

excelenergy

Board Regular
Joined
Jun 7, 2012
Messages
142
Hello,

I have two workbooks.
Workbook1 and
Workbook2
I would like Workbook2 to look for only my dogs name in Workbook1, cell C6 then once is name is found pull all the corresponding row information from A1 to H1 then paste it into Workbook2, cell A1 to H1.

I there a formula for this? VLookup wont work :(
 
Last edited:

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I would go with vlookup but you would have to do 1 formula in each cell from A1 to H1

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Cell[/TD]
[TD]Formula[/TD]
[/TR]
[TR]
[TD]A1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,1,0)[/TD]
[/TR]
[TR]
[TD]B1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,2,0)[/TD]
[/TR]
[TR]
[TD]C1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,3,0)[/TD]
[/TR]
[TR]
[TD]D1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,4,0)[/TD]
[/TR]
[TR]
[TD]E1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,5,0)[/TD]
[/TR]
[TR]
[TD]F1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,6,0)[/TD]
[/TR]
[TR]
[TD]G1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,7,0)[/TD]
[/TR]
[TR]
[TD]H1[/TD]
[TD]=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,8,0)[/TD]
[/TR]
</tbody>[/TABLE]


With macro:

Code:
Sub Copy_row()
    Set l1 = Workbooks("workbook1.xlsx")
    Set h1 = l1.Sheets(1)
    Set b = h1.Columns("A").Find(ActiveSheet.Range("C6").Value, lookat:=xlWhole, LookIn:=xlValues)
    If Not b Is Nothing Then
        h1.Rows(b.Row).Copy Range("A1")
    End If
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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