#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Functions

I have 10 names in sheet1, 15 names in sheet2 out of which 4 are same as
sheet 1.
Now I want to display the names of remaining 6 persons of sheet1 and 11
persons name of sheet2 in sheet3
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Functions

With a little tweaking for your specific scenario, one of these should help:
http://www.cpearson.com/excel/Duplicates.aspx

http://www.contextures.com/xlFunctions02.html


Regards,
Ryan--

--
RyGuy


"Sanjib" wrote:

I have 10 names in sheet1, 15 names in sheet2 out of which 4 are same as
sheet 1.
Now I want to display the names of remaining 6 persons of sheet1 and 11
persons name of sheet2 in sheet3

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Functions

Are the 10 names on Sheet1 and the 15 names on Sheet2 all the names in their
respective columns, or are you picking 10 and 15 names from a subset of a
longer list of names?

Are there any gaps in the name lists (that is, are the lists contiguous, or
can there be missing "names" in between the names that are there)?

Can the names be placed on Sheet3 in any order, or does one list have to
come before the other (and, if so, which is first)?

Rick


"Sanjib" wrote in message
...
I have 10 names in sheet1, 15 names in sheet2 out of which 4 are same as
sheet 1.
Now I want to display the names of remaining 6 persons of sheet1 and 11
persons name of sheet2 in sheet3


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Functions



"Rick Rothstein (MVP - VB)" wrote:

Are the 10 names on Sheet1 and the 15 names on Sheet2 all the names in their
respective columns, or are you picking 10 and 15 names from a subset of a
longer list of names?

Are there any gaps in the name lists (that is, are the lists contiguous, or
can there be missing "names" in between the names that are there)?

Can the names be placed on Sheet3 in any order, or does one list have to
come before the other (and, if so, which is first)?

Rick


"Sanjib" wrote in message
...
I have 10 names in sheet1, 15 names in sheet2 out of which 4 are same as
sheet 1.
Now I want to display the names of remaining 6 persons of sheet1 and 11
persons name of sheet2 in sheet3


10 & 15 Names are in their respective columns

No gaps in the name list
It could be placed in any order in sheet3
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Functions

10 & 15 Names are in their respective columns
No gaps in the name list
It could be placed in any order in sheet3


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default Functions

10 & 15 Names are in their respective columns
No gaps in the name list
It could be placed in any order in sheet3


Give the following macro a try. Where indicated, adjust the Worksheet names
and the Range references (the "A1:A" parts) for each worksheet to match your
actual worksheets names, columns and starting row for the lists.

Rick

Sub CopyNames()
Dim X As Long
Dim Cel As Range
Dim WS1range As Range
Dim WS2range As Range
Dim LongerList As Range
Dim ShorterList As Range
Dim WS3 As Worksheet
Dim EmptyCell As Long
' **** Adjust references to match your worksheet ****
With Worksheets("Sheet1")
Set WS1range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
With Worksheets("Sheet2")
Set WS2range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
Set WS3 = Worksheets("Sheet3")
' ************************************************** *
If WS1range.Count WS2range.Count Then
Set LongerList = WS1range
Set ShorterList = WS2range
Else
Set LongerList = WS2range
Set ShorterList = WS1range
End If
LongerList.Copy Destination:=WS3.Range("A1")
For Each Cel In ShorterList
EmptyCell = WS3.Cells(Rows.Count, "A").End(xlUp).Row + 1
If WS3.Range("A1:A" & EmptyCell).Find(Cel.Text) Is Nothing Then
WS3.Range("A" & EmptyCell).Value = Cel.Text
End If
Next
End Sub

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Functions



"Rick Rothstein (MVP - VB)" wrote:

10 & 15 Names are in their respective columns
No gaps in the name list
It could be placed in any order in sheet3


Give the following macro a try. Where indicated, adjust the Worksheet names
and the Range references (the "A1:A" parts) for each worksheet to match your
actual worksheets names, columns and starting row for the lists.

Rick

Sub CopyNames()
Dim X As Long
Dim Cel As Range
Dim WS1range As Range
Dim WS2range As Range
Dim LongerList As Range
Dim ShorterList As Range
Dim WS3 As Worksheet
Dim EmptyCell As Long
' **** Adjust references to match your worksheet ****
With Worksheets("Sheet1")
Set WS1range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
With Worksheets("Sheet2")
Set WS2range = .Range("A1:A" & .Cells(Rows.Count, "A").End(xlUp).Row)
End With
Set WS3 = Worksheets("Sheet3")
' ************************************************** *
If WS1range.Count WS2range.Count Then
Set LongerList = WS1range
Set ShorterList = WS2range
Else
Set LongerList = WS2range
Set ShorterList = WS1range
End If
LongerList.Copy Destination:=WS3.Range("A1")
For Each Cel In ShorterList
EmptyCell = WS3.Cells(Rows.Count, "A").End(xlUp).Row + 1
If WS3.Range("A1:A" & EmptyCell).Find(Cel.Text) Is Nothing Then
WS3.Range("A" & EmptyCell).Value = Cel.Text
End If
Next
End Sub

Cant we make it with any FUNCTION

i would b thankful
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
formula/functions for average and if functions Petu71 Excel Worksheet Functions 2 August 5th 07 08:25 PM
XL2003 FILTER FUNCTIONS VS. XL2007 FILTER FUNCTIONS RET70168 Excel Worksheet Functions 0 June 15th 07 01:00 AM
efficiency: database functions vs. math functions vs. array formula nickname Excel Discussion (Misc queries) 2 July 14th 06 04:26 AM
Looking for a site with functions that substitute the ATP functions Franz Verga Excel Worksheet Functions 3 June 24th 06 04:30 AM
Nesting functions in the functions dialog box cs170a Excel Worksheet Functions 0 June 10th 05 10:36 PM


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