Please read the forum rules when including code and USE CODE TAGS (I did so you saw how it looks)
Private Sub SpinButton1_SpinUp()
Dim tmpDate As Date
tmpDate = DateSerial(Year(CDate(TextBox1.Text)), Month(CDate(TextBox1.Text)), Day(CDate(TextBox1.Text)))
tmpDate = tmpDate + 30
if year(tmpDate) < 2065 Then TextBox1.Text = Format(tmpDate, "mmm yy")
End Sub
Private Sub SpinButton1_SpinDown()
Dim tmpDate As Date
tmpDate = DateSerial(Year(CDate(TextBox1.Text)), Month(CDate(TextBox1.Text)), Day(CDate(TextBox1.Text)))
tmpDate = tmpDate - 30
if year(tmpDate)> 2018 Then TextBox1.Text = Format(tmpDate, "mmm yy")
End Sub
You must also check that the linked cell is updated too
Bookmarks