Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need to compare one row in one excel (Wx) with another excel (Wy) and if they are same, i need to copy the adjacent cell info from Wy to Wx correspondingly.
Say Wx is the first sheet and the column is BO and Wy is the second excel and the column is E and these two columns are to be compared and for the same values the corresponding info from the column C of Wy has to be copied in to the column BX of Wx EggHeadCafe - Software Developer Portal of Choice Fast KeyWord String searching Algorithms http://www.eggheadcafe.com/tutorials...ing-searc.aspx |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Try this: Sub CompareCopy() Dim shA As Worksheet Dim shB As Worksheet Set shA = Worksheets("Wx") Set shB = Worksheets("Wy") FirstRow = 2 'Headings in row 1 LastRow = shA.Range("BO" & Rows.Count).End(xlUp).Row For Each cell In shA.Range("BO" & FirstRow & ":BO" & LastRow) Set f = shB.Columns("E").Find _ (what:=cell.Value, Lookat:=xlWhole, LookIn:=xlValues) If Not f Is Nothing Then f.Offset(0, -1).Copy cell.Offset(0, 8) Set f = Nothing End If Next End Sub Regards, Per "Terrence Brown" skrev i meddelelsen ... I need to compare one row in one excel (Wx) with another excel (Wy) and if they are same, i need to copy the adjacent cell info from Wy to Wx correspondingly. Say Wx is the first sheet and the column is BO and Wy is the second excel and the column is E and these two columns are to be compared and for the same values the corresponding info from the column C of Wy has to be copied in to the column BX of Wx EggHeadCafe - Software Developer Portal of Choice Fast KeyWord String searching Algorithms http://www.eggheadcafe.com/tutorials...ing-searc.aspx |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel copy data | Excel Worksheet Functions | |||
How copy none excel data & paste in 2007 without overwriting data | Excel Discussion (Misc queries) | |||
Copy excel data (inc. textbox data) into Word | Excel Discussion (Misc queries) | |||
for each doc in dir, copy data to excel | Excel Programming | |||
Copy data from IE to Excel | Excel Programming |