Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 287
Default transfering data from one sheet to another(merging)

hi,
On sheet 1, the first column has the customer id# and other columns have
other details of that costumer(like: email, fax...)
On sheet 2 , the first column has the customer id#(doesn't have all the ID#
that sheet 1 has) and other columns have other information.

what can I do so it will look at each customer id# on sheet 2 look for for a
match on sheet 1 and add those additional columns from sheet 2 in that same
row on sheet1.
Please provide me the formula and explanation of the formula.
im unexperienced with this and need to do this on a very large sheet with
lots of data.
thank you.

example:
Sheet1:
CusID Phone Fax
1 XXX XXX
2 XXX XXX
3 XXX XXX
4 XXX XXX

Sheet 2
CusID Adress zip
2 XXX XXX
4 XXX XXX

MY result will be:
CusID Phone Fax Adress Zip
1 XXX XXX
2 XXX XXX XXX XXX
3 XXX XXX
4 XXX XXX XXX XXX

Thank you
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,071
Default transfering data from one sheet to another(merging)

Adam
What you want cannot be done with a formula. You need to use VBA
(programming).
The following macro will do what you want. I assumed your sheets are named
"One" and "Two". I also assumed your data started in row 2. Change these
as needed to work with what you have. HTH Otto
Sub CopyDups()
Dim rColAOne As Range
Dim rColATwo As Range
Dim RngToCopy As Range
Dim i As Range
Dim FoundRow As Long
Application.ScreenUpdating = False
Sheets("One").Select
Set rColAOne = Range("A2", Range("A" & Rows.Count).End(xlUp))
With Sheets("Two")
Set rColATwo = .Range("A2", .Range("A" & Rows.Count).End(xlUp))
End With
For Each i In rColATwo
If Not rColAOne.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing
Then
FoundRow = rColAOne.Find(What:=i.Value,
LookAt:=xlWhole).Row
With Sheets("Two")
Set RngToCopy = .Range(i.Offset(, 1), .Cells(i.Row,
Columns.Count).End(xlToLeft))
RngToCopy.Copy Cells(FoundRow,
Columns.Count).End(xlToLeft).Offset(, 1)
End With
End If
Next i
Application.ScreenUpdating = True
End Sub

"adam" wrote in message
...
hi,
On sheet 1, the first column has the customer id# and other columns have
other details of that costumer(like: email, fax...)
On sheet 2 , the first column has the customer id#(doesn't have all the
ID#
that sheet 1 has) and other columns have other information.

what can I do so it will look at each customer id# on sheet 2 look for for
a
match on sheet 1 and add those additional columns from sheet 2 in that
same
row on sheet1.
Please provide me the formula and explanation of the formula.
im unexperienced with this and need to do this on a very large sheet with
lots of data.
thank you.

example:
Sheet1:
CusID Phone Fax
1 XXX XXX
2 XXX XXX
3 XXX XXX
4 XXX XXX

Sheet 2
CusID Adress zip
2 XXX XXX
4 XXX XXX

MY result will be:
CusID Phone Fax Adress Zip
1 XXX XXX
2 XXX XXX XXX XXX
3 XXX XXX
4 XXX XXX XXX XXX

Thank you



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
Merging multiple sheets into one sheet without overwriting data. E. Miller Excel Worksheet Functions 0 March 6th 08 05:18 PM
transfering data from one sheet to another JDR Excel Discussion (Misc queries) 4 March 7th 07 05:58 PM
Transfering data from worksheet to another Tasha Excel Discussion (Misc queries) 0 May 15th 06 03:20 PM
Transfering Data from Several Sheets to another Adalan Excel Worksheet Functions 0 January 16th 06 05:50 PM
Transfering data from 1 worksheet to another Larry L Excel Discussion (Misc queries) 1 August 29th 05 01:30 PM


All times are GMT +1. The time now is 12:47 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"