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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I would go with vlookup but you would have to do 1 formula in each cell from A1 to H1

CellFormula
A1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,1,0)
B1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,2,0)
C1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,3,0)
D1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,4,0)
E1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,5,0)
F1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,6,0)
G1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,7,0)
H1=VLOOKUP(C6,[workbook1.xlsx]Hoja1!$A:$H,8,0)

<tbody>
</tbody>


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,214,385
Messages
6,119,210
Members
448,874
Latest member
b1step2far

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