Find Max day in a month
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
Dim Rng As Range
Set Rng = Range("F3")
If Not Intersect(Target, Rng) Is Nothing Then
Range("A2:B13").ClearContents
MonthNumber = 1
Do While MonthNumber < 13
Cells(MonthNumber + 1, 1).Value = MonthName(MonthNumber, True)
If MonthNumber = 1 Then
Application.Wait (Now + TimeValue("00:00:01"))
End If
Cells(MonthNumber + 1, 2).Value = Day(DateSerial(Range("F3").Value, MonthNumber + 1, 0))
MonthNumber = MonthNumber + 1
Loop
MsgBox "Hi " & Application.UserName & " Process Completed"
Application.Speech.Speak ("Hi " & Application.UserName & " Process Completed")
End If
Application.EnableEvents = True
End Sub