Option Explicit
Sub Vergleich()
Call EventsOff
Dim tab1y As Long
Dim tab2y As Long
Dim tab3y As Long
Dim zaehler0 As Long
Dim zaehler1 As Long
Dim tab3x As Integer
tab1y = Sheets(1).UsedRange.SpecialCells(xlCellTypeLastCell).Row
tab2y = Sheets(2).UsedRange.SpecialCells(xlCellTypeLastCell).Row
If tab1y > tab2y Then
tab3y = tab1y
Else
tab3y = tab2y
End If
Rem hier deine spalte der Identifikationsnummer ,entsprechend anzupassen,zur zeit 3
tab3x = 3
ReDim arr1(tab3y, tab3x) As Variant
ReDim arr2(tab3y, tab3x) As Variant
Sheets(2).Select
arr2() = Range(Cells(1, 1), Cells(tab3y, tab3x))
Sheets(1).Select
arr1() = Range(Cells(1, 1), Cells(tab3y, tab3x))
For zaehler0 = 2 To tab3y
For zaehler1 = 2 To tab3y
If arr1(zaehler0, 1) = arr2(zaehler1, 1) And arr1(zaehler0, 2) = arr2(zaehler1, 2) Then
arr1(zaehler0, tab3x) = arr2(zaehler1, tab3x)
End If
Next zaehler1
Next zaehler0
Range(Cells(1, 1), Cells(tab3y, tab3x)) = arr1()
Call EventsOn
End Sub
Public Sub EventsOff()
With Application
.ScreenUpdating = False
.EnableEvents = False
.Calculation = xlCalculationManual
End With
End Sub
Public Sub EventsOn()
With Application
.ScreenUpdating = True
.EnableEvents = True
.Calculation = xlCalculationAutomatic
End With
End Sub
Neueste Inhalte aus mehreren Tabellen auslesen
Bappkopp 12.03.2007 - 145 Hits - 2 Antworten
Suche in mehreren Tabellen
Chiyo 23.08.2007 - 81 Hits - 6 Antworten
2 Tabellen vergleichen + Übereinstimmung auswerfen
depe 28.08.2007 - 169 Hits - 3 Antworten
Tabellenvergleich
chilli 22.11.2007 - 258 Hits -
SVerweis
Mustafa 20.02.2008 - 85 Hits - 6 Antworten