Herbers Excel-Forum - das Archiv
doppelte einträge
Betrifft: doppelte einträge
von: chri
Geschrieben am: 11.11.2003 17:49:21
hallo,
wie kann ich in einem excel-sheet doppelte einträge aus spalte a in spalte b auswerfen, dh ich möchte jeden eintrag der in spalte a doppelt ist auch in spalte b haben.
danke
chri
Betrifft: AW: doppelte einträge
von: Nepumuk
Geschrieben am: 11.11.2003 18:12:48
Hallo chri,
so geht's:
Option Explicit
Public Sub doppelte()
Dim varArray() As Variant, lngZeile1 As Long, lngZeile2 As Long
Application.ScreenUpdating = False
ReDim varArray(1 To Cells(65536, 1).End(xlUp).Row)
varArray = Range(Cells(1, 1), Cells(Cells(65536, 1).End(xlUp).Row, 1))
For lngZeile1 = 1 To Cells(65536, 1).End(xlUp).Row - 1
For lngZeile2 = lngZeile1 + 1 To Cells(65536, 1).End(xlUp).Row
If varArray(lngZeile1, 1) = varArray(lngZeile2, 1) Then Cells(lngZeile2, 2) = varArray(lngZeile2, 1)
Next
Next
Application.ScreenUpdating = True
End Sub
Code eingefügt mit: Excel Code Jeanie
Gruß
Nepumuk