Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
text box percent field
is there a way to have a text box on a userform automatically be set up to
receive a percent number amount? a user would be typing in, say...40%. i would like if the text box could already have a percent sign and whatever they type in the text box would be followed by that percent sign. i tried, Userform.TextBox.Value = Userform.TextBox.Value & "%" but that just repeated itself until the character max was filled. TIA. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
text box percent field
Userform.TextBox.Value =
Application.Substitute(Userform.TextBox.Value,"%", "") & "%" -- Regards, Tom Ogilvy "Spencer Hutton" wrote in message ... is there a way to have a text box on a userform automatically be set up to receive a percent number amount? a user would be typing in, say...40%. i would like if the text box could already have a percent sign and whatever they type in the text box would be followed by that percent sign. i tried, Userform.TextBox.Value = Userform.TextBox.Value & "%" but that just repeated itself until the character max was filled. TIA. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
text box percent field
Spencer,
You could try this. Private Sub textbox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger ByVal Shift As Integer) 'tab key Application.ScreenUpdating = False If KeyCode = "9" Or KeyCode = "13" Then With UserForm1 .TextBox1.Text = .TextBox1.Text & " " & "%" End With End If End Sub When the user tabs off or press the enter key the % will be placed i the textbox. Charle -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combining Percent with Text | Excel Discussion (Misc queries) | |||
Trouble sorting first by a dates field and then by a text field. | Excel Discussion (Misc queries) | |||
Changing a text field to a date field | New Users to Excel | |||
How to keep leading zero without changing field to text field? | Excel Discussion (Misc queries) | |||
HELP!! Populate text in single XL field, or bulk copy text into 1 field | Excel Programming |