joining worksheets

J

Jessica

I see all these very complicated explanations and procedures for combining
worksheets, but I still can't figure out what to do!
I exported 2 separate contact lists from Outlook into Excel. I want to
combine them and eliminate duplicte entries so that I have one master list to
work from, to update, and then to email to people in my organization to get
more/updated contact information.
I pasted each contact list onto a separate sheet in one worksheet. Please
help from here.
 
E

Eduardo

Hi Jessica,
Put both list together and run the macro as follow

Dim LastRow2 As Long
Dim TestColumn As String
Dim RowNdx As Long
Dim TopRow As Long
Dim WS As Worksheet
Dim DeleteThese As Range



Set WS = ActiveSheet
TestColumn = "B" '<<<< column to test for duplicates
TopRow = 6 '<<<< top-most row of data to test.

With WS
LastRow2 = .Cells(.Rows.Count, TestColumn).End(xlUp).Row
For RowNdx = LastRow2 To TopRow Step -1
If Application.CountIf(.Range(.Cells(TopRow, TestColumn), _
.Cells(RowNdx, TestColumn)), _
.Cells(RowNdx, TestColumn)) > 1 Then
If DeleteThese Is Nothing Then
Set DeleteThese = .Rows(RowNdx)
Else
Set DeleteThese = _
Application.Union(DeleteThese, .Rows(RowNdx))
End If
End If
Next RowNdx
End With
If Not DeleteThese Is Nothing Then
DeleteThese.Delete
End If

End Sub
 
X

xlmate

Hi Jessica

If both list have the same layout format, put both list together
and try this formula in C2. Assume that Col A is the name, Col B is the
contact
=COUNTIF($A$2:$A$10,A2)>1

this will return TRUE if there are duplicates, then filter for TRUE and
delete the duplicates. Use this if your list is small.

Better still, try Advance Filter via
Select all the data in the list
Go to Data in the menu bar
select Filter >> Advance Filter
Excel would have select the range for you which is equal to your dataset, if
not
use your mouse to select all the data
Under Action, check Copy to Another location
In Copy to, select a blank cell outside your dataset
check the Unique records only
click OK

This will give you unique entries in the new location, copy this to
where you want it to be.


--
Hope this is helpful

Appreciate that you provide your feedback by clicking the Yes button below
if this post have helped you.


Thank You

cheers, francis
 
J

Jessica

Both you and eduardo write to put the lists together - do you mean just copy
and past ALL the data from both worksheets into one??

Thank you both!
 
X

xlmate

Hi Jessica

Yes, you are right...copy and paste either one of the sheet onto another.

--
Hope this is helpful

Appreciate that you provide your feedback by clicking the Yes button below
if this post have helped you.


Thank You

cheers, francis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top