Code-Hilfe
MatthiasJ
ich habe folgenden Code:
Sub Try()
Dim OutApp As Object, Mail As Object
Dim x As Integer
Dim y As Integer
Dim Nachricht
For x = 1 To Cells(65536, 5).End(xlUp).Row
For y = 1 To Cells(65536, 5).End(xlUp).Row
If Cells(x, 5) = Cells(y, 5) Then
Set OutApp = CreateObject("Outlook.Application")
Set Nachricht = OutApp.CreateItem(0)
With Nachricht
.To = Cells(x, 12)
.Subject = "Pending Action Item Reminder--> " & Cells(x, 2) & "; " & Cells(y, 2)
.Body = "Please check your scheduler!" & vbCrLf & Cells(x, 8) & Cells(y, 8)
.Display
End With
Set OutApp = Nothing
Set Nachricht = Nothing
Application.Wait (Now + TimeValue("0:00:02"))
End If
Next x
Next y
End Sub
Ich bekomme jedesmal den Fehler:
"Fehler beim kompilieren:
Ungültiger Verweis auf Next-Steuervariable"
Kann mir da jemand raushelfen?
MFG
Matthias