Userform | Evoke Textbox change event when radio button is changed

Boffa

New Member
Joined
May 8, 2019
Messages
17
I have three radio buttons that the user can select

Uppercase
Lowercase
Propercase

When the form initializes the Uppercase radio button is set to true

if the user selects one of the radio buttons I want the text already keyed into a textbox to update to the choosen radio button

I have attempted to do this using the change event on the textbox - The issue I have with this is the user needs to click back into the textbox and key in a space or more text to envoke the change event so the text updates

Is there a way so that as soon as one of the radio buttons is selected the text in the textbox updates immediately ?

Private Sub TextBox_EmployeeName_Change()
If OptionButton_ProperCase.Value = True Then
Me.TextBox_EmployeeName.Value = Application.WorksheetFunction.Proper(Me.TextBox_EmployeeName)
ElseIf OptionButton_UpperCase.Value = True Then
Me.TextBox_EmployeeName.Value = UCase(Me.TextBox_EmployeeName)
Else
Me.TextBox_EmployeeName.Value = LCase(Me.TextBox_EmployeeName)
End If
End Sub
 

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,717
Office Version
2013
Platform
Windows
I would think this would work:
Code:
Private Sub Uppercase_Click()
'Modified  11/3/2019  1:34:48 AM  EST
TextBox_EmployeeName.Value = UCase(TextBox_EmployeeName.Value)
End Sub
Private Sub Lowercase_Click()
'Modified  11/3/2019  1:34:48 AM  EST
TextBox_EmployeeName.Value = LCase(TextBox_EmployeeName.Value)
End Sub
Private Sub Propercase_Click()
'Modified  11/3/2019  1:34:48 AM  EST
TextBox_EmployeeName.Value = Application.WorksheetFunction.Proper(TextBox_EmployeeName.Value)
End Sub
 

Boffa

New Member
Joined
May 8, 2019
Messages
17
Ah ha makes perfect sense - Dont know why I didnt think of the click event on the actual Radio buttons
thanks for quick reply!
 

My Aswer Is This

Well-known Member
Joined
Jul 5, 2014
Messages
16,717
Office Version
2013
Platform
Windows
Glad I was able to help you.
Come back here to Mr. Excel next time you need additional assistance.
Ah ha makes perfect sense - Dont know why I didnt think of the click event on the actual Radio buttons
thanks for quick reply!
 

Forum statistics

Threads
1,089,164
Messages
5,406,544
Members
403,095
Latest member
cyclingdad

This Week's Hot Topics

Top