Calculate Next 1 Year Date Based On Userform Textbox

HECGroups

Board Regular
Joined
Jan 16, 2012
Messages
164
Hello Again,

I am looking for a help to calculate next year date when a user enter any date on userform textbox 9

Example: If a user enter 01-01-2016 in textbox9 then the result on textbox10 will be 31-12-2016.

Can someone help me please.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi,
try:

Code:
Private Sub TextBox9_Change()
    With Me.TextBox9
        If IsDate(.Text) Then Me.TextBox10.Text = DateSerial(Year(.Text) + 1, Month(.Text), 0) Else Me.TextBox10.Text = ""
    End With
End Sub

Dave
 
Upvote 0
Thanks for your reply.

I have another question. How can I check multiple textbox's length of characters is more than 3 or not.
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top