![]() |
Compare two columns and copy data if values are the same.
I've tried figuring this out with formulas but I think I need a vba solution. I've got a column with values in column A in sheet 1 and I've got a column of values in column G of sheet 2. Every value in column G sheet2 is one of the values from column A sheet 1. What I need is something that will compare G to the whole column of A and then copy the value from cell B from sheet 1 to Column H in sheet 2. Example: Sheet 1 Sheet 2 A B G H 1 1 1 2 8 1 3 4 2 4 6 4 5 3 4 4 5 Would become Sheet 2 G H 1 1 1 1 2 8 4 6 4 6 4 6 5 3 Any help would be appreciated. |
Compare two columns and copy data if values are the same.
Ok the advertisement messed up the layout. Sheet 1 Sheet 2 A B G H 1 1 1 2 8 1 3 4 2 4 6 4 5 3 5 Would become Sheet 2 G H 1 1 1 1 2 8 4 6 5 3 |
Compare two columns and copy data if values are the same.
It looks like you could use =vlookup() or =index(match())
=vlookup(g1,sheet1!a:b,2,false) Debra Dalgleish has lots of notes: http://www.contextures.com/xlFunctions02.html (for =vlookup()) and http://www.contextures.com/xlFunctions03.html (for =index(match())) and http://contextures.com/xlFunctions02.html#Trouble Akhorahil wrote: Ok the advertisement messed up the layout. Sheet 1 Sheet 2 A B G H 1 1 1 2 8 1 3 4 2 4 6 4 5 3 5 Would become Sheet 2 G H 1 1 1 1 2 8 4 6 5 3 -- Dave Peterson |
All times are GMT +1. The time now is 05:28 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com