AW: 3 Spalten ohne Duplikate in neue Spalte per VBA
21.10.2016 11:32:36
Michael
Hallo!
Warum nicht gleich mit richtigen Infos?
Sub a()
Dim Wb As Workbook: Set Wb = ThisWorkbook
Dim WsQ As Worksheet, WsZ As Worksheet
Dim Daten As Range, Ziel As Range
With Wb
Set WsZ = .Worksheets("Tabelle3") 'Ziel-Tabelle
With .Worksheets("Tabelle5") 'Quell-Tabelle A usw...
Set Daten = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
Set Ziel = WsZ.Cells(WsZ.Rows.Count, 1).End(xlUp).Offset(1, 0)
Daten.AdvancedFilter Action:=xlFilterCopy, _
copytorange:=Ziel, unique:=True
End With
With .Worksheets("Tabelle7")
Set Daten = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
Set Ziel = WsZ.Cells(WsZ.Rows.Count, 1).End(xlUp).Offset(1, 0)
Daten.AdvancedFilter Action:=xlFilterCopy, _
copytorange:=Ziel, unique:=True
End With
With .Worksheets("Tabelle12")
Set Daten = .Range(.Cells(1, 1), .Cells(.Rows.Count, 1).End(xlUp))
Set Ziel = WsZ.Cells(WsZ.Rows.Count, 1).End(xlUp).Offset(1, 0)
Daten.AdvancedFilter Action:=xlFilterCopy, _
copytorange:=Ziel, unique:=True
End With
End With
End Sub
LG
Michael