PDA

View Full Version : Solved: Solved-Format Phone Number



texasalynn
08-01-2006, 08:53 AM
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:


( 666 ) 222 - 2222
999/333-3333

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
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

lucas
08-01-2006, 09:54 AM
If its in a cell you can right click on the cell, select format cells
then under the number tab at the top of the dialog select special and phone number. enter your ten numbers without hyphens etc.

texasalynn
08-01-2006, 09:56 AM
thanks for the help

I solved it and edited my original post. I'm not sure how to mark the post as "Solved"

lucas
08-01-2006, 09:56 AM
sorry, misunerstood..

lucas
08-01-2006, 09:57 AM
use the thread tools at the top of the page