Hi Tom tnks for previous answer
Tom in sheet1 in column A & B i have alphanumeric codes. in sheet2 in column are names of customers. i need is when i enter names in sheet1 in column C and click on  column A and column B codes that codes shud get copied on sheet2 in front of that matching name in columnn A and column B. for example in sheet1 in C4 i write Tom and click on A4 and B4 code then these codes shud get copied  in sheet2 where there is Tom suppose Tom is in A17 so codes shud get copied in B17 and C17 in sheet2. i tried with hyperlink but failed to yield.


What you describe would require a macro.  However, since you didn't try to construct a macro, then I assume you would want to use a formula.  Say you data starts in row 2 of each sheet with headers in row 1.  Then in sheet2 (not sheet1), in B2 you would put in a formula like this


B2: =IF(COUNTIF(Sheet1!$C:$C,$A2)>0,INDEX(Sheet1!$A:$A,MATCH($A2,Sheet1!$C:$C,0),1),"")
C2: =IF(COUNTIF(Sheet1!$C:$C,$A2)>0,INDEX(Sheet1!$B:$B,MATCH($A2,Sheet1!$C:$C,0),1),"")

then select B2:C2 and drag fill down columns B and C for as far as you have entries in column A.

The cells in Sheet2 in columns A and B will appear blank until you enter a matching name in column C of sheet1.  When you do, the codes in columns A and B of the matching row will appear in columns B and C of sheet2 next to the name.

I have entered representative data in test worksheets and followed the steps above and the formulas produces the expected codes when matching names were found.

the formulas will update as soon as the entry is made in column C of sheet1.  You do not have to click in columns A or B of sheet1.  

I would recommend this approach if you are not a macro programmer and I have assumed you are not.  

Tom Ogilvy  
About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2016 About.com. All rights reserved.