ich möchte gerne zwei Spalteninhalte vergleichen und die Einträge in einer Auswertungsspalte nur einmal aufführen.
Bsp.
Spalte A : A B C D E
Spalte B : F G C D A
Ziel: A B C D E F G
Vielen Dank für einen Tip.
Matthias
ich möchte gerne zwei Spalteninhalte vergleichen und die Einträge in einer Auswertungsspalte nur einmal aufführen.
Bsp.
Spalte A : A B C D E
Spalte B : F G C D A
Ziel: A B C D E F G
Vielen Dank für einen Tip.
Matthias
folgendes kleines Makro erledigt das für Dich:
Sub check()
Dim sp1 As Range
Dim sp2 As Range
Dim IntSp1 As Integer, IntSp2 As Integer
Dim IntSp3 As Integer, IntSp4 As Integer
IntSp1 = 1 'Nummer der 1. Spalte
IntSp2 = 2 'Nummer der 2. Spalte
IntSp3 = 3 'Spaltennummer Ausgabebereich
IntSp4 = 256 'Nummer der Hilfsspalte (wird wieder gelöscht)
Set sp1 = Range(Cells(Cells(1, IntSp1).End(xlDown).Row, IntSp1), _
Cells(Cells(65536, IntSp1).End(xlUp).Row, IntSp1))
Set sp2 = Range(Cells(Cells(1, IntSp2).End(xlDown).Row, IntSp2), _
Cells(Cells(65536, IntSp2).End(xlUp).Row, IntSp2))
Cells(1, 256).Value = "Ergebnis"
sp1.Copy Destination:=Cells(2, IntSp4)
sp2.Copy Destination:=Cells(sp1.Rows.Count + 2, IntSp4)
With Range(Cells(1, IntSp4), Cells(sp1.Rows.Count + sp2.Rows.Count + 1, IntSp4))
.AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Cells(1, IntSp3), Unique:=True
.Delete Shift:=xlShiftUp
End With
End Sub
Jetzt musst Du nur noch Diene Spaltennummer anpassen und das Makro starten, dann sollte es klappen.
Steffan.
Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden
Suche nach den besten AntwortenEntdecke unsere meistgeklickten Beiträge in der Google Suche
Top 100 Threads jetzt ansehen