Reputation: 4966
I have phone numbers listed in Column A of Sheet1. Currently they dont have any format and are stored as: 1112223333
I want to convert them to: 111.222.3333
I tried:
Format(Worksheets("Sheet1").Range("A1").Value, "###.###.####")
which gives me "1112223333.."
EDIT: When I try to format it to:
Format(Worksheets("Sheet1").Range("A1").Value, "(###) ###-####")
It works perfectly fine: (111) 222-3333
Its just with the "111.222.3333" format that I am having issues with. Am I missing something here?
Thanks in advance
Upvotes: 3
Views: 8898
Reputation: 27478
The periods need to be converted to text, otherwise they're read as decimal points:
Worksheets("Sheet1").Range("A1").NumberFormat = "###"".""###"".""####"
Upvotes: 6