AW: Spaltenvergleich
04.08.2003 12:14:03
WernerB.
Hallo Margrit,
wie gefällt Dir das:
Sub Margrit()
Dim SuBe As Range
Dim s As String
Dim i As Long, laRA As Long, LaRE As Long
Application.ScreenUpdating = False
laRA = Cells(Rows.Count, 1).End(xlUp).Row
LaRE = Cells(Rows.Count, 5).End(xlUp).Row
For i = 1 To laRA
s = Cells(i, 1).Value
Set SuBe = Range(Cells(1, 5), Cells(LaRE, 5)). _
Find(s, lookat:=xlWhole)
If Not SuBe Is Nothing Then
Cells(i, 2).Value = "gefunden"
Cells(SuBe.Row, 6).Value = "gefunden"
Else
Cells(i, 2).Value = "nicht gefunden"
End If
Next i
For i = 1 To LaRE
s = Cells(i, 5).Value
Set SuBe = Range(Cells(1, 1), Cells(laRA, 1)). _
Find(s, lookat:=xlWhole)
If Not SuBe Is Nothing Then
Cells(i, 6).Value = "gefunden"
Cells(SuBe.Row, 2).Value = "gefunden"
Else
Cells(i, 6).Value = "nicht gefunden"
End If
Next i
Set SuBe = Nothing
Application.ScreenUpdating = True
End Sub
Viel Erfolg wünscht
WernerB.