Array
08.01.2008 12:55:36
michael
Könnt ihr mir bitte den Nachfolgenden Code so umschreiben
das er NUR die ActiveCell überprüft.
Sub KtNummernVergleich()
Dim varZahlen, c As Range, i As Integer, blnFound As Boolean
varZahlen = Array(8000, 8001, 8002, 8003, 8006, 8007, 8008, _
8010, 8011, 8098, 8099, 8101, 8102, 8103, 8500, 8501, _
7000, 7011, 7012, 7015, 7016, 7017, 7019, 7021, 7022, 7023, 7100, _
4189, 4190, 4191, 4210, 4280, 4380, 4381, 4610, 4640, 4910, 4911, 4920, _
4930, 4940, 4941, 4942, 4943, 4944, 4945, 4946, 4960, 4961, 4970, 9000)
For Each c In Range("F10:F80")
blnFound = False
If c "" Then
For i = 0 To UBound(varZahlen)
If c = varZahlen(i) Then
blnFound = True
Exit For
End If
Next i
If blnFound = False Then
MsgBox c.Value & " gibt es nicht"
c.Select
Exit Sub
End If
End If
Next c
End Sub
Danke (der kleine) michael