Unique list from multiple sheets

joand

Active Member
Joined
Sep 18, 2003
Messages
266
In a workbook I have about a hundred worksheets. I want to extract from each sheet the data in Column C to a Master sheet. I need to extract only the unique items from the generated list. Is this possible?

Any help would be appreciated.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
How about this...

Please test on a copy workbook first!

Create a workbook called Master and this worksheet will be excluded.

Code:
Sub MergeMyData()
Dim ws As Worksheet
Application.ScreenUpdating = False

    For Each ws In ActiveWorkbook.Worksheets
        If ws.Name <> "Master" Then
            ws.Range("C1", ws.Range("C" & ws.Rows.Count).End(xlUp)).Copy Sheets("Master").Range("B" & Rows.Count).End(xlUp).Offset(1)
        End If
    Next ws

With Sheets("Master").Range("B1", Range("B" & Rows.Count).End(xlUp))
    .Sort Key1:=Range("B1"), _
        Order1:=xlAscending, _
        Header:=xlNo, _
        OrderCustom:=1, _
        MatchCase:=False, _
        Orientation:=xlTopToBottom, _
        DataOption1:=xlSortNormal
End With
Sheets("Master").Range("B1", Range("B" & Rows.Count).End(xlUp)).AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Sheets("Master").Range("A1"), Unique:=True
Sheets("Master").Range("B1", Range("B" & Rows.Count).End(xlUp)).ClearContents

Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,096
Messages
6,123,074
Members
449,094
Latest member
mystic19

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