I am using this code to filter sheet 1 unique values from column to H1 to J1 to sheet2 range A1 to C1.
But however I getting issues when I add or delete sheets in the workbook.
So I would like to use sheettab names instead of sheet1 and sheet2 .
So Sheet1 have sheetname tab "CustomerA"
and
Sheet2 have sheetname tab "Report"
Sub FilterUnique()
'Tariff No Description Origin
With Sheet2
.Range("A1:C1").Value = Sheet1.Range("H1:J1").Value
' ''./// clear any existing data
.Range("A1").CurrentRegion.Offset(1).Clear
'/// copy required data to summary sheet
Sheet1.Range("A1").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=.Range("A1:C1"), Unique:=True
.Range("A1:C1").Columns.AutoFit
End With
End Sub
Bookmarks