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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,215,788
Messages
6,126,907
Members
449,348
Latest member
Rdeane

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