Messagebox nur wenn Geburtstag
31.12.2020 12:35:16
Roland
Ich habe folgenden Code in einem Forum (Eintrag schon mehr als 3 Jahre her) gefunden.
Der ua. Code funktioniert auch wunderbar.
Ich habe nur eine Frage.
Die Messagebox wird auch angezeigt, wenn kein Geburtstag anfällt. Kann mir da bitte jemand behilflich sein, wie ich den Code im Modul umändern muss, damit die Messagebox nur dann erscheint, wenn auch tatsächlich jemand Geburtstag hat?
Dieser Code steht in "diese Arbeitsmappe"
Call RPP
End Sub
Dieser Code steht in einem Modul
Option Explicit
Dim Birthday As String
Sub RPP()
Birthday = "Aktuelle Geburtstage:" & vbLf & String(80, "-") & vbLf
Ausgabe Format(Date, "dd. mmmm")
MsgBox Birthday, , "Geburtstagsmeldung"
Birthday = vbNullString
End Sub
Sub Ausgabe(Heute As String)
Dim Fund As Range, firstAddress As String
Set Fund = Tabelle1.Columns(61).Find(Heute, , xlValues, xlWhole)
If Not Fund Is Nothing Then
firstAddress = Fund.Address
Do
Birthday = Birthday & _
Fund.Offset(0, -2) & vbLf
Set Fund = Tabelle1.Columns(61).FindNext(Fund)
Loop While Not Fund Is Nothing And Fund.Address firstAddress
End If
Set Fund = Nothing
End Sub