copy data vba

1

1234

Hi,

I need a macro that searches the client name in b2 in other workbook
that has a sheet for each client. So the name´s cliente in B2 should
match matches with the client´s name sheet and copy the data of row a2
to e2. Is this possible?

Thanks
 
B

Bernie Deitrick

CN = Range("B2").Value
Workbooks("Other Workbook.xls").Worksheets(CN).Range("A2:E2").Copy
Range("C2:G2")

HTH,
Bernie
MS Excel MVP



Hi,

I need a macro that searches the client name in b2 in other workbook
that has a sheet for each client. So the name´s cliente in B2 should
match matches with the client´s name sheet and copy the data of row a2
to e2. Is this possible?

Thanks
 
B

Bernie Deitrick

Sorry, word wrapping created a third line from what should have only been two lines of code. Adding
a continuation character will fix it.

CN = Range("B2").Value
Workbooks("Other Workbook.xls").Worksheets(CN).Range("A2:E2").Copy _
Range("C2:G2")

HTH,
Bernie
MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top