Private Sub TextBox1_Change()
If IsDate(TextBox1) Then
TextBox2 = Day(DateSerial(Year(TextBox1), Month(TextBox1) + 1, 0))
Else
TextBox2 = ""
End If
End Sub
Private Sub UserForm_Activate()
TextBox1.Text = Date - 1
TextBox2 = Day(DateSerial(Year(TextBox1), Month(TextBox1) + 1, 0))
End Sub
Private Sub TextBox1_Change()
If IsDate(TextBox1) Then
TextBox2 = Day(DateSerial(Year(TextBox1), Month(TextBox1) + 1, 0))
Else
TextBox2 = ""
End If
End Sub
Private Sub UserForm_Activate()
TextBox1.Text = Date - 1
TextBox2 = Day(DateSerial(Year(TextBox1), Month(TextBox1) + 1, 0))
End Sub