Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Rachel,
no worries - glad it worked & thanks for feedback. -- jb "Rachel" wrote: Hi John, Sorry for the late response - I actually couldn't find my question after posting it!! Your codes worked perfectly, thank you so much!! "john" wrote: Rachel, place both these procedures behind your form & see if it does what you want. the Exit routine ensures format is applied after user has updated entry. Hope helpful Private Sub chkmobile_Click() With Me.txtphone .Text = Replace(Replace(.Text, " ", ""), "-", "") If Me.chkmobile.Value = True Then .Text = Format(.Text, "0000-000-000") Else .Text = Format(.Text, "00-0000-0000") End If End With End Sub Private Sub txtphone_Exit(ByVal Cancel As MSForms.ReturnBoolean) Call chkmobile_Click End Sub -- jb "Rachel" wrote: I have a text box (txtphone) in a user form that a user will enter a phone number into. The default format of this text box is to be "00-0000-0000". I want them to be able to tick a check box (chkmobile) if the number is a mobile number and the format of txtphone is to change to "0000-000-000". If they then untick chkmobile the format returns to "00-0000-0000". Is this possible? Thanks :) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Check boxes and text strikethrough / color change | Excel Worksheet Functions | |||
How to change the font size for text within check box? | Excel Discussion (Misc queries) | |||
Change Date Format to Specific Text Format When Copying | Excel Discussion (Misc queries) | |||
how do I change the text size of a form check box | New Users to Excel | |||
Automatically change the text color when you check out the checkbo | Excel Discussion (Misc queries) |