I'm sure there's more information that you're not telling us. What column has the "Chas" data? is "Chas" the same column in all tabs? or does the macro have to locate it? I created two files with the mentioned sheet names and put about 1000 random numbers in each sheet. Then I created the following macro to find the unique values and put them in sheet(1) of the "current" workbook: Option Explicit Sub Uniquelist() Dim wb As Workbook Dim rCnt As Integer Dim R As Integer Dim sht Dim Dict_Unique Dim tArray Set Dict_Unique = CreateObject("Scripting.Dictionary") Dict_Unique.RemoveAll Workbooks.Open "C:\temp\VBA\File1.xlsx", ReadOnly:=True For Each sht In Array("A", "B", "C") rCnt = Application.WorksheetFunction.CountA(ActiveWorkbook.Sheets(sht).Range("A1:A65000")) For R = 1 To rCnt If (Not Dict_Unique.exists(ActiveWorkbook.Sheets(sht).Cells(R, "A").Value)) Then Dict_Unique.Add ActiveWorkbook.Sheets(sht).Cells(R, "A").Value, sht End If Next R Next sht ActiveWorkbook.Close savechanges:=False Workbooks.Open "C:\temp\VBA\File2.xlsx", ReadOnly:=True sht = "D" rCnt = Application.WorksheetFunction.CountA(ActiveWorkbook.Sheets(sht).Range("A1:A65000")) For R = 1 To rCnt If (Not Dict_Unique.exists(ActiveWorkbook.Sheets(sht).Cells(R, "A").Value)) Then Dict_Unique.Add ActiveWorkbook.Sheets(sht).Cells(R, "A").Value, sht End If Next R ActiveWorkbook.Close savechanges:=False ThisWorkbook.Sheets(1).Range("A2:A65000").ClearContents tArray = Dict_Unique.keys For R = 0 To UBound(tArray) ThisWorkbook.Sheets(1).Cells(R + 2, "A").Value = tArray(R) Next R End Sub
Paul ----------------------------------------- “Do all the good you can, By all the means you can, In all the ways you can, In all the places you can, At all the times you can, To all the people you can, As long as ever you can.” - John Wesley ----------------------------------------- From: Sara Lee <lee.sar...@gmail.com> >To: excel-macros@googlegroups.com >Sent: Tuesday, November 25, 2014 2:32 AM >Subject: $$Excel-Macros$$ macro required for finding uniques > > > >I have a excel file which has 3 tabs by name A,B,C and then another excel >file with tab D - both the files are in server in same location. > > >All 4 tabs in both the files have one common column called as Chas > > >Can any one help me please to get a macro which can create a unique(no >duplicates) list of all >values for column Chas from all 4 tabs in both files. > > >Please send a file which has a macro in it. thank u much -- >Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s >=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ >https://www.facebook.com/discussexcel > >FORUM RULES > >1) Use concise, accurate thread titles. Poor thread titles, like Please Help, >Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get >quick attention or may not be answered. >2) Don't post a question in the thread of another member. >3) Don't post questions regarding breaking or bypassing any security measure. >4) Acknowledge the responses you receive, good or bad. >5) Jobs posting is not allowed. >6) Sharing copyrighted material and their links is not allowed. > >NOTE : Don't ever post confidential data in a workbook. Forum owners and >members are not responsible for any loss. >--- >You received this message because you are subscribed to the Google Groups "MS >EXCEL AND VBA MACROS" group. >To unsubscribe from this group and stop receiving emails from it, send an >email to excel-macros+unsubscr...@googlegroups.com. >To post to this group, send email to excel-macros@googlegroups.com. >Visit this group at http://groups.google.com/group/excel-macros. >For more options, visit https://groups.google.com/d/optout. > > > -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at http://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.