der code den ich hier habe funktioniert soweit. Wollte aber noch das in Tabelle1 die Zelle W1 gelöscht wird. Das was ich dem Code zugefügt habe klappt leider nicht.
Könnte mir jemand sagen was ich falsch gemacht habe?
mfg Kai
Public Sub Eintragen()
Dim loZeile As Long, loSpalte As Long, i As Long
Dim vaPassnummer As Variant, strSpieltag As String
With Worksheets("Tabelle1")
Range("W1").ClearContents
If WorksheetFunction.CountBlank(.Range("C5:C10")) _
+ WorksheetFunction.CountBlank(.Range("H5:H10")) = 12 Then
MsgBox "Es wurde kein Spieler ausgewählt."
Exit Sub
End If
End With
With Worksheets("Tabelle2")
For i = 12 To 23
If Worksheets("Spielbericht").Range("C4") "" Then
If Worksheets("Spielbericht").Cells(i, 2) "" Then
vaPassnummer = Worksheets("Spielbericht").Cells(i, 2).Value
strSpieltag = Worksheets("Spielbericht").Range("C4").Value
loSpalte = .Rows(1).Find(what:=strSpieltag, LookIn:=xlValues, lookat:=xlWhole, _
searchorder:=xlByColumns, searchdirection:=xlNext).Column
loZeile = .Columns(2).Find(what:=vaPassnummer, LookIn:=xlValues, lookat:=xlWhole, _
searchorder:=xlByRows, searchdirection:=xlNext).Row
.Cells(loZeile, loSpalte) = "X"
End If
Else
MsgBox "Es wurde kein Spieltag gewählt."
Exit Sub
End If
Next i
End With
End Sub