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:

Some videos you may like

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
10,225
Office Version
2007
Platform
Windows
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:

Watch MrExcel Video

Forum statistics

Threads
1,090,056
Messages
5,412,101
Members
403,412
Latest member
sonicroc

This Week's Hot Topics

Top