Für Code Experten
11.02.2005 17:30:50
Dieter
habe unten stehenden Code bekommen der nur bei Excel XP läuft, ich möchte diesen Code auch unter Office 97 verwenden.Leider bleibt er an der gekennzeichneten Stelle stehen.
Wer kann mir da weiter helfen ?
Gruss Dieter
Private Sub CommandButton1_Click()
Dim Zusatzzahl
Titel = "Zusatzzahl"
Mldg = "Zusatzzahl eingeben"
Zusatzzahl = InputBox(Mldg, Titel)
With Sheets(1).Range(Cells(101, 2), Cells(126, 3))
Set C = .Find(Zusatzzahl, LookIn:=xlValues, LookAt:=xlWhole)'<<<<<<<<<<<<<<<<<
If C Is Nothing Then
r = Cells(100, 2).End(xlUp).Row + 1
Cells(r, 5) = "xxx"
Cells(r, 3) = "nein"
Cells(r, 2) = Zusatzzahl
Cells(r, 6) = "nein"
MsgBox "Zusatzzahl nicht vorhanden"
Exit Sub
End If
End With
r = Cells(100, 2).End(xlUp).Row + 1
If r < 4 Then r = 5
If C(1, 1).Column = 2 Then f = 0 Else f = -1
Cells(r, 5) = C(1, f)
Cells(r, 2) = C(1, 1)
Cells(r, 3) = "ja"
Cells(r, 4) = 36
Cells(r, 6) = "ja"
For i = Cells(100, 3).End(xlUp).Row To 5 Step -1
If Cells(i - 1, 3) <> "ja" Then
Cells(r, 4) = Cells(r, 4) + 36
Else
i = 5
End If
Next i
With Sheets(2).Columns(1)
Spieler = Cells(r, 5)
Set S = .Find(Spieler, LookIn:=xlValues, LookAt:=xlWhole)
If S Is Nothing Then
i = .Cells(65536, 1).End(xlUp).Row + 1
.Cells(i, 1) = Cells(r, 5)
.Cells(i, 2) = 1
Else
S(1, 2) = S(1, 2) + 1
S(1, 3) = S(1, 3) + Cells(r, 4)
End If
End With
End Sub