So i have the following macro, which extracts unique values from column C of a workbook with multiple sheets and pastes it to a new page. I do realize their is another question similar, but I do not understand it. Is there a way to:
1) do this amongst a directory of files?
2) put new values into a master sheet instead of just making a new sheet in each file:
Sub extractuniquevalues()
Dim wks As Excel.Worksheet
Dim wksSummary As Excel.Worksheet
'----------------------------------------------------------------------------------
On Error Resume Next
Set wksSummary = Excel.ThisWorkbook.Worksheets("Unique data")
On Error GoTo 0
If wksSummary Is Nothing Then
Set wksSummary = Excel.ThisWorkbook.Worksheets.Add
wksSummary.Name = "Unique data"
End If
'Iterate through all the worksheets, but skip [Summary] worksheet.
For Each wks In Excel.ActiveWorkbook.Worksheets
With wksSummary
If wks.Name <> .Name Then
If Application.WorksheetFunction.CountA(wks.Range("C:C")) Then
Call wks.Range("C:C").AdvancedFilter(xlFilterCopy, , .Cells(.Cells(.Rows.Count, 1).End(xlUp).Row + 1, 1), True)
End If
End If
End With
Next wks
End Sub
Any help would be Greatly Appreciated, Thanks.