Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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
![]()
Posted to microsoft.public.excel.worksheet.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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
formula/functions for average and if functions | Excel Worksheet Functions | |||
XL2003 FILTER FUNCTIONS VS. XL2007 FILTER FUNCTIONS | Excel Worksheet Functions | |||
efficiency: database functions vs. math functions vs. array formula | Excel Discussion (Misc queries) | |||
Looking for a site with functions that substitute the ATP functions | Excel Worksheet Functions | |||
Nesting functions in the functions dialog box | Excel Worksheet Functions |