Application.match umkehren
Burghard
ich bräuchte mal Hilfe. Nachfolgendes Makro würde ich gerne umkehren:
Sub Vergleich()
Dim wks As Worksheet
Dim var As Variant
Dim iRow As Integer
Set wks = Worksheets("Tabelle2")
For iRow = 1 To WorksheetFunction.CountA(Columns(2))
var = Application.Match(Cells(iRow, 2).Value, wks.Columns(2), 0)
If Not IsError(var) Then
Cells(iRow, 2).Interior.ColorIndex = 40
End If
Next iRow
End Sub
==============Ich will aber nicht die gleichen Werte markieren lassen, sondern nur die ungleichen.
Könnte ungefähr so sein:
Sub Vergleich()
Dim wks As Worksheet
Dim var As Variant
Dim iRow As Integer
Set wks = Worksheets("Tabelle2")
For iRow = 1 To WorksheetFunction.CountA(Columns(2))
===> var = Application.NotMatch(Cells(iRow, 2).Value, wks.Columns(2), 0)
If Not IsError(var) Then
Cells(iRow, 2).Interior.ColorIndex = 40
End If
Next iRow
End Sub
=============Hilfe wäre nett.
Schönen Gruß
Burghard