rahulbassi268
New Member
- Joined
- Sep 23, 2016
- Messages
- 14
Hello All,
I am building a userform for pharma data entry. The Expiry date is actually just a month & year. Not a date in actual.
So, I have a textbox in userform named Expiry_TxtBox.
I have below requirements:
I am building a userform for pharma data entry. The Expiry date is actually just a month & year. Not a date in actual.
So, I have a textbox in userform named Expiry_TxtBox.
I have below requirements:
- If user enters 4 characters like 0525, it should get itself modified to 05/25 (It must retain leading zero too)
- If user enters slash like 08/26, system should accept it as such.
VBA Code:
Private Sub Expiry_TxtBox_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Expiry_TxtBox.Text = Format$(Expiry_TxtBox.Text, "##/##")
End Sub