Userform | Evoke Textbox change event when radio button is changed

Boffa

New Member
Joined
May 8, 2019
Messages
27
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
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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
 
Upvote 0
Ah ha makes perfect sense - Dont know why I didnt think of the click event on the actual Radio buttons
thanks for quick reply!
 
Upvote 0
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!
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,579
Members
452,653
Latest member
craigje92

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