Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default how to extract duplicated data from two seperate worksheets?

Ok,

Suppose I have 2 worksheets.

Sheet 1 has 1000 lines of data spanning xNumber of columns.

Sheet 2 has 500 lines of data, also spanning the same number of columns.
An unknown number of identical lines of data appear on both sheets.

How can I get to a point where I can build one worksheet that is a composite
of both sheets - such that no identical line of data appears twice on the
final sheet?


Thanks in advance, Simon.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,290
Default how to extract duplicated data from two seperate worksheets?

Also posted in the public.excel group




"simon steel"
wrote in message
Ok,
Suppose I have 2 worksheets.
Sheet 1 has 1000 lines of data spanning xNumber of columns.
Sheet 2 has 500 lines of data, also spanning the same number of columns.
An unknown number of identical lines of data appear on both sheets.
How can I get to a point where I can build one worksheet that is a composite
of both sheets - such that no identical line of data appears twice on the
final sheet?
Thanks in advance, Simon.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default how to extract duplicated data from two seperate worksheets?

I found this macro on this DG a while back:

Sub matchsheets()

Sh1RowCount = 1
Sh3RowCount = 1
With Sheets("Sheet1")
Do While .Range("A" & Sh1RowCount) < ""
SSN = .Range("A" & Sh1RowCount)
With Sheets("Sheet2")
Set c = .Columns("A:A").Find(what:=SSN, _
LookIn:=xlValues)
If Not c Is Nothing Then
With Sheets("Sheet3")
..Range("A" & Sh3RowCount) = SSN
Sh3RowCount = Sh3RowCount + 1
End With
End If
End With
Sh1RowCount = Sh1RowCount + 1
Loop
End With
End Sub

All matches in Sheet1 and Sheet2, go to Sheet3.

Hope that gives you what you want.

Regards,
Ryan---



--
RyGuy


"Jim Cone" wrote:

Also posted in the public.excel group




"simon steel"
wrote in message
Ok,
Suppose I have 2 worksheets.
Sheet 1 has 1000 lines of data spanning xNumber of columns.
Sheet 2 has 500 lines of data, also spanning the same number of columns.
An unknown number of identical lines of data appear on both sheets.
How can I get to a point where I can build one worksheet that is a composite
of both sheets - such that no identical line of data appears twice on the
final sheet?
Thanks in advance, Simon.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default how to extract duplicated data from two seperate worksheets?

My macro experience is limited, so not sure if it does what i want.

I want to end up with one set of data that consists of data from both sheets
on one sheet with no duplicated lines.
Is that what you're saying this will do?

[Can't trial it right now and see the effect 'cos the data is at work and
I'm at home.

simon


"ryguy7272" wrote in message
...
I found this macro on this DG a while back:

Sub matchsheets()

Sh1RowCount = 1
Sh3RowCount = 1
With Sheets("Sheet1")
Do While .Range("A" & Sh1RowCount) < ""
SSN = .Range("A" & Sh1RowCount)
With Sheets("Sheet2")
Set c = .Columns("A:A").Find(what:=SSN, _
LookIn:=xlValues)
If Not c Is Nothing Then
With Sheets("Sheet3")
.Range("A" & Sh3RowCount) = SSN
Sh3RowCount = Sh3RowCount + 1
End With
End If
End With
Sh1RowCount = Sh1RowCount + 1
Loop
End With
End Sub

All matches in Sheet1 and Sheet2, go to Sheet3.

Hope that gives you what you want.

Regards,
Ryan---



--
RyGuy


"Jim Cone" wrote:

Also posted in the public.excel group




"simon steel"
wrote in message
Ok,
Suppose I have 2 worksheets.
Sheet 1 has 1000 lines of data spanning xNumber of columns.
Sheet 2 has 500 lines of data, also spanning the same number of columns.
An unknown number of identical lines of data appear on both sheets.
How can I get to a point where I can build one worksheet that is a
composite
of both sheets - such that no identical line of data appears twice on the
final sheet?
Thanks in advance, Simon.





  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default how to extract duplicated data from two seperate worksheets?

Try it at work tomorrow. Try it with a backup file or a copy of your file!!
Always test code on backup files; if you obtain undesired results you could
cause irrecoverable damage to your only data source.

Regards,
Ryan--

--
RyGuy


"simon steel" wrote:

My macro experience is limited, so not sure if it does what i want.

I want to end up with one set of data that consists of data from both sheets
on one sheet with no duplicated lines.
Is that what you're saying this will do?

[Can't trial it right now and see the effect 'cos the data is at work and
I'm at home.

simon


"ryguy7272" wrote in message
...
I found this macro on this DG a while back:

Sub matchsheets()

Sh1RowCount = 1
Sh3RowCount = 1
With Sheets("Sheet1")
Do While .Range("A" & Sh1RowCount) < ""
SSN = .Range("A" & Sh1RowCount)
With Sheets("Sheet2")
Set c = .Columns("A:A").Find(what:=SSN, _
LookIn:=xlValues)
If Not c Is Nothing Then
With Sheets("Sheet3")
.Range("A" & Sh3RowCount) = SSN
Sh3RowCount = Sh3RowCount + 1
End With
End If
End With
Sh1RowCount = Sh1RowCount + 1
Loop
End With
End Sub

All matches in Sheet1 and Sheet2, go to Sheet3.

Hope that gives you what you want.

Regards,
Ryan---



--
RyGuy


"Jim Cone" wrote:

Also posted in the public.excel group




"simon steel"
wrote in message
Ok,
Suppose I have 2 worksheets.
Sheet 1 has 1000 lines of data spanning xNumber of columns.
Sheet 2 has 500 lines of data, also spanning the same number of columns.
An unknown number of identical lines of data appear on both sheets.
How can I get to a point where I can build one worksheet that is a
composite
of both sheets - such that no identical line of data appears twice on the
final sheet?
Thanks in advance, Simon.






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
create chart with data from across seperate worksheets Diz Charts and Charting in Excel 3 December 23rd 07 04:00 PM
Linking data from Rows to columns in seperate worksheets davidge Excel Worksheet Functions 1 August 11th 07 10:37 PM
HOW DO I IDENTIFY DATA THAT IS DUPLICATED IN TWO SEPERATE WORKSHEE SPURLING Excel Discussion (Misc queries) 2 June 27th 06 02:05 PM
Create single chart with data from seperate worksheets MATT Charts and Charting in Excel 1 May 10th 06 04:09 AM
How do I seperate data from a pivot into seperate worksheets? Shannon Excel Discussion (Misc queries) 5 August 25th 05 06:07 AM


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