Re: Zeichenketten in Zellen suchen
19.09.2002 14:49:22
Chris
Private Sub CommandButton1_Click()
Dim a, b, za, zbza = 0
For i = 1 To 10000
Sheets("Ziel").Select
za = za + 1
If ActiveSheet.Cells(i, 1).Formula = "" Then GoTo exit1
Next i
exit1:
za = za - 1
zb = 0
Sheets("Quelle").Select
zb = 0
For i = 1 To 10000
zb = zb + 1
If ActiveSheet.Cells(i, 1).Formula = "" Then GoTo exit2
Next i
exit2:
zb = zb - 1
For i = 1 To zb
Sheets("Quelle").Select
a = ActiveSheet.Cells(i, 1).Formula
b = ActiveSheet.Cells(i, 2).Formula
Sheets("Ziel").Select
For ii = 1 To za
If ActiveSheet.Cells(ii, 1).Formula Like "*" & a & "*" Then
ActiveSheet.Cells(ii, 2).Formula = b
ActiveSheet.Cells(ii, 2).Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
End If
Next ii
Next i
End Sub
Die Blätter sind mit Quelle und Ziel beschriftet.
Gruss
Chris