ich wollte zwei tabellen vergleichen. Habe von Hajo auch folgendes makro(habe es einwenig modifiziert),
Sub Vergleichen()
Dim LoI As Long
Dim LoJ As Long
Dim LoLetzte1 As Long
Dim LoLetzte2 As Long
Dim BoNein As Boolean
LoLetzte1 = 65536
With Worksheets("Tabelle1")
If .Range("b65536") = "" Then LoLetzte1 = .Range("b65536").End(xlUp).Row
End With
LoLetzte2 = 65536
With Worksheets("Tabelle2")
If .Range("b65536") = "" Then LoLetzte2 = .Range("b65536").End(xlUp).Row
End With
For LoI = 1 To LoLetzte1
For LoJ = 1 To LoLetzte2
' Leerzellen nicht kennzeichnen
If Worksheets("Tabelle1").Cells(LoI, 2) <> "" Then
If Worksheets("Tabelle1").Cells(LoI, 2) = Worksheets("Tabelle2").Cells(LoJ, 2) Then
Worksheets("Tabelle1").Cells(LoJ, 2).Interior.ColorIndex = 4
BoNein = True
End If
End If
Next LoJ
If BoNein = False Then
Worksheets("Tabelle1").Cells(LoI, 2).Interior.ColorIndex = 3
End If
BoNein = False
Next LoI
End Sub
nur vergleicht es nicht richtig. Manche werden richtig verglichen und eingefärbt und manche nicht. Voran liegt das?
Könnt ihr mir helfen,
hier das Beispiel
https://www.herber.de/bbs/user/20713.xls
Vielen Dank für die hilfe
MFG
artur