Unique records from 5 different Ranges

gheyman

Well-known Member
Joined
Nov 14, 2005
Messages
2,342
Office Version
  1. 365
Platform
  1. Windows
Is it possible to look at 5 different ranges (i.e. A1:A200) on five different sheets and pull out only the unique records from those ranges?

Sheets("Sheet1").Range("A1:A200") and Sheets("Sheet2").Range("A1:A400").....

THANKS!
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Yes this is possible.
What are the names of the worksheets?
Where do you want the results to be copied to?
 
Upvote 0
You can use Advanced Filter to do this.
Select your column of data.
Data | Filter...
Choose Advanced Filter...
check "Filter to another location"
In "Copy to" Field, choose cell you want Unique data to be copied to.
check Unique records only
Click OK
 
Upvote 0
John

The sheet names are Sheets("ENG Labor Summary).Range("A22:A200) and Sheets("OPS Labor Summary").Range("A22:A400")

It can be copied to: Sheets("WBS Dictionary").Range("A1")

If you can figure this one out that would really help.
 
Upvote 0
Uniques Records

Thanks

Unfortionately, I was hoping to do this in either a macro or VBA. The problem with using the advanced Filter is you can only do one range at a time. Plus I was trying to automate the task. This excel program has many users. Some have very basic excel skills and Filters are beyond their capability.

Thanks for your time. Much appreciated.
 
Upvote 0
You can record a macro to do this then edit the code. We can help with the latter.
 
Upvote 0
Try this code:
Code:
Sub AFTest1()
EndRow = Sheets("WBS Dictionary").Cells(Rows.Count, "A").End(xlUp).Row + 1
Set TargCell = Sheets("WBS Dictionary").Range("A" & EndRow)
Set FilterRng = Sheets("ENG Labor Summary").Range("A22:A200")
    FilterRng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=TargCell, Unique:=True
    
EndRow = Sheets("WBS Dictionary").Cells(Rows.Count, "A").End(xlUp).Row + 1
Set TargCell = Sheets("WBS Dictionary").Range("A" & EndRow)
Set FilterRng = Sheets("OPS Labor Summary").Range("A22:A200")
    FilterRng.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=TargCell, Unique:=True
End Sub
 
Upvote 0
Thanks!!!!

That worked perfectly. I tried to record running the Advance filter and got nothing.

What you have is pefect - Datsmart!
 
Upvote 0
You are correct, recording Advanced Filtering seems to be worthless.
I have tried to collect as much code as possible for advanced filtering from posts on this forum. It pays off later.
 
Upvote 0

Forum statistics

Threads
1,215,890
Messages
6,127,595
Members
449,386
Latest member
owais87

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top