Results 1 to 5 of 5

Thread: Solved: Solved-Format Phone Number

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Newbie texasalynn's Avatar
    Joined
    Jun 2004
    Location
    Houston
    Posts
    2
    Location

    Solved: Solved-Format Phone Number

    I've searched for this but haven't found the right word match.

    I need to have a macro that looks at the phone number and format it. For example I have this:

    [vba]
    ( 666 ) 222 - 2222
    999/333-3333
    [/vba]
    I want all the phone numbers to look like the 1st one. But not sure how to go about it. Would appreciate suggestions/help.

    ---------------------------------
    I figured it out
    [VBA] For i = 2 To WSC
    Phone = Cells(i, 40).Value
    If Left(Phone, 1) = "(" Then
    ' leave info unchanged
    Else
    Cells(i, 40).Value = "( " & Left(Phone, 3) & " ) " & Mid(Phone, 5, 3) & " - " & Right(Phone, 4)
    End If
    Next i
    [/VBA]
    Last edited by texasalynn; 08-01-2006 at 09:50 AM. Reason: text layout

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •