den Code habe ich aus dem Internet, er soll aus einer Geburtstagsliste die Geburtstage zwischen HEUTE()-3 und HEUTE()+20 in einer MsgBox anzeigen, dazu soll noch das Alter angeführt werden.
Allerdings wird in der MsgBox nichts angezeigt. Wo liegt der Fehler? Option Explicit Sub GeburtstageAuflisten() Dim i As Integer Dim bStr As String Dim LzB As Long LzB = Application.Max(2, Cells(Rows.Count, 2).End(xlUp).Row) bStr = "" For i = 1 To Cells(LzB, 1).End(xlUp).Row Debug.Print Cells(i, 1) If Format(Cells(i, 1).Value, "dd.mm.yyyy") >= Format(Now - 3, "dd.mm.yyyy") _ And Format(Cells(i, 1).Value, "dd.mm.yyyy") https://www.herber.de/bbs/user/96816.xlsm
Besten Dank für die Hilfe und Servus, Walter