Solved

Match Cell Content, Replace whole Row

Posted on 2011-03-24
5
263 Views
Last Modified: 2012-05-11
Hi Experts,

I have an situation, which is like this

Sheet 1
 Row1        Col 1    Col 2        Col3, etc
 Row2        1          Apple       nnn
 Row3        some information
 Row4
 Row5        2          Banana    mmm
 Row6        some information


Sheet 2
 Row1        Col 1    Col 2        Col3, etc
 Row2        1          Papaya     xxx
 Row3        some information
 Row4        papaya@farm.com
 Row5
 Row6        2          Banana    yyy
 Row7        some information
 Row8        Banana@farm.com

i would love a way to match a Cell in Col2 of both sheets, once match like Banana in Sheet 1 and Sheet 2, whole Row6 of Sheet2 will be replaced with Row5 of Sheet 1. the outcome is as below (note that col3 the "description" of Banana being replaced)

 Sheet 2
 Row1        Col 1    Col 2        Col3, etc
 Row2        1          Papaya     xxx
 Row3        some information
 Row4        papaya@farm.com
 Row5
 Row6        2          Banana    mmm
 Row7        some information
 Row8        Banana@farm.com

i will need a script on this, to match more than 1000 accounts.

Thanks!
0
Comment
Question by:pepelepew8
  • 3
  • 2
5 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 250 total points
ID: 35205719
Try this file. I have used formulas instead of VBA. You will have to select the first four lines and copy down by dragging.
Lookup-dataset-on-keyword.xlsx
0
 
LVL 1

Author Comment

by:pepelepew8
ID: 35212964
Hi ssaqibh,

i had downloaded the file and try to use it, but it seems im confused with the code, can please help explaining the code?

thanks so that i am also able to customize it

cheers =D
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 35213094
I have not inserted any code. If there is code it was from your original file.

Saqib
0
 
LVL 1

Author Comment

by:pepelepew8
ID: 35213663
Hi Saqib,

sorry for didnt make it clear, i mean this formula

=IF(ISNA(MATCH(B6,Sheet1!B:B,0)),Sheet2!C6,INDEX(Sheet1!$A$1:$C$10000,MATCH(B6,Sheet1!B:B,0),3))

can help explaining abit? thanks =D
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 35213710
Before I explain, please tell me is it working as desired?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now