Change Textbox Value based on another Textbox

Alrabia

New Member
Joined
May 14, 2018
Messages
6
Hi,
I have a User form with text boxes. I am looking to have Emp10 autofill with either "Rented" or "Expired". If I have value in Emp6 with an upcoming date then Emp10 should show "Rented" and if Emp6 has a Due date then it should show "Expired" in Emp10. Emp6 is used to input date.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try this.
Code:
Private Sub Emp6_Exit(ByVal Cancel As MSForms.ReturnBoolean)

    If DateValue(Emp6.Value) < Date Then
        Emp10.Value = "Expired"
    Else
        Emp10.Value = "Due"
    End If
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,199
Members
453,022
Latest member
RobertV1609

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