اخى واستاذنا محمد
وهذا حل اخر بالكود
Sub month_days()
Dim m As Integer, y As Integer, DaysInMonth As Integer
m = Format([b2], "mm")
y = Format([b2], "yyyy")
DaysInMonth = DateSerial(y, m + 1, 1) - DateSerial(y, m, 1)
[d2] = DaysInMonth
End Sub
تقبل تحياتى