Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Copy data from one excel to another

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default Copy data from one excel to another

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel copy data Paul Gardiner Excel Worksheet Functions 2 October 15th 09 05:17 AM
How copy none excel data & paste in 2007 without overwriting data Wakefootin Excel Discussion (Misc queries) 2 October 8th 09 12:15 AM
Copy excel data (inc. textbox data) into Word Sarah (OGI) Excel Discussion (Misc queries) 0 August 14th 07 05:00 PM
for each doc in dir, copy data to excel Max Bialystock[_2_] Excel Programming 1 April 30th 07 10:30 AM
Copy data from IE to Excel Maxi[_2_] Excel Programming 0 March 7th 06 03:42 PM


All times are GMT +1. The time now is 06:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"