Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Text Box
How do i get a text box on a form to only allow a certain way to fill the box
in. Such as a text box for a phone number and I want the input to be limited to look like the following: (555)555-5555 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Text Box
This works in a worksheet range:
Sub Numbfmt() Range("C3").NumberFormat = "(###)###-###0" End Sub "krc547" wrote: How do i get a text box on a form to only allow a certain way to fill the box in. Such as a text box for a phone number and I want the input to be limited to look like the following: (555)555-5555 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Form Text Box
untested but something like this may work:
Private Sub TextBox1_Change() If IsNumeric(TextBox1.Text) Then If Len(TextBox1.Text) = 10 Then mynum = Format(TextBox1.Text, "(###)###-###0") TextBox1.Text = mynum End If End If End Sub -- JB "krc547" wrote: How do i get a text box on a form to only allow a certain way to fill the box in. Such as a text box for a phone number and I want the input to be limited to look like the following: (555)555-5555 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
User Form Text Boxes - Copy format of text boxes | Excel Discussion (Misc queries) | |||
2 criteria lookup of text. Return text form column 3. SUMPRODUCT t | Excel Worksheet Functions | |||
DATE IN TEXT FORM - NEED TO CHANGE IT DATE FORM | New Users to Excel | |||
Formatting text in a user form text box | Excel Programming | |||
VBA - Form Text box value | Excel Programming |