Hallo nok106,
ich weiß jetzt nicht, ob ich Dich richtig verstanden habe, aber versuche es mal mit folgendem VBA-Code.
Kopiere das Makro in das VBA-Projekt "DieseArbeitsmappe" und tausche es gegen Dein vorhandenen VBA-Code aus.
Teste das Makro aber bitte in einer Testdatei und nicht gleich in Deiner Originaldatei.
Option Explicit
Sub Workbook_Open()
Dim Datum As Date
Dim Zeile As Long
Dim Namen As String
Zeile = 2
Do Until IsEmpty(Cells(Zeile, 6))
Datum = Cells(Zeile, 6)
With Range(Cells(Zeile, 1), Cells(Zeile, 6))
.Interior.ColorIndex = xlNone
If Month(Day(Datum) & "." & Month(Datum) & "." & Year(Datum)) >= Month(Now) Then
.Interior.ColorIndex = 19
If CDate(Day(Datum) & "." & Month(Datum) & "." & Year(Date)) >= Date Then
.Interior.ColorIndex = 35
Namen = Namen & Cells(Zeile, 1) & vbLf
End If
End If
End With
Zeile = Zeile + 1
Loop
If Namen <> "" Then
MsgBox Namen, vbInformation, "Medikamente bestellen:"
Else
MsgBox "", vbExclamation, "Es liegen keine Bestell-Daten vor!"
End If
End Sub
MfG,
Oliver
[sub]Da hier der einzige Lohn für die Helfer eine Rückmeldung ist, wäre es nett, wenn Du[/sub]
[sup] ein Feedback abgeben könntest, ob der Lösungsvorschlag Dein Problem gelöst hat.[/sup]