There are multiple people using this worksheet to, and they all have their own way of inputting phone numbers. I am trying to allow only one type of formatting. Here is the code. [Sub PhoneNumberFormat()
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 4 And Len(Trim(Target.Value)) > 0 Then
Target.Value = onlyNumbers(Target.Value)
Target.NumberFormat = "(000) 000-0000"
End If
End Sub
Private Function onlyNumbers(myVal As Variant) As Variant
Dim l As Integer
For l = 1 To Len(myVal)
If IsNumeric(Mid(myVal, l, 1)) Then onlyNumbers = onlyNumbers & Mid(myVal, l, 1)
Next l
End Function]
I have attached the file because I am having some hang up issues.
Thanks for your assistance.