Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assuming you have a lot of these and want to convert them in place, then you
can use this macro to do that... Sub ReformatPhonenumbers() Dim R As Range For Each R In UsedRange If R.Value Like "###-###-####" Then R.Value = "(" & Replace(R.Value, "-", ")", , 1) End If Next End Sub Anything having 3 digits followed by a dash followed by 3 more digits followed by another dash followed by 4 digits will be converted. By the way, if you meant there to be space after the closing parenthesis, then put a space after the ")" inside of the Replace function. Rick "Labtyda" wrote in message ... This is from a data base that was given to me. I have tried to format the cells, but it won't change them. Any suggestions? thanks, Jean |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to put dashes in a number 13000000000 to 1300-000-0000 | Excel Discussion (Misc queries) | |||
How can I get 0000 in Every Column N every Excel file by default? | Excel Discussion (Misc queries) | |||
what is the minimum numbers set for 4 digit numbers from 0000 to 9 | Excel Discussion (Misc queries) | |||
Phone number format from 000.000.0000 to (000)000-0000 | Excel Discussion (Misc queries) | |||
(social security number) 000-00-0000 to 000000000 | Excel Discussion (Misc queries) |