copy data vba

  • Thread starter Thread starter 1234
  • Start date Start date
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
 
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
 
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
 
Back
Top